Make WordPress Core

Changeset 25869


Ignore:
Timestamp:
10/22/2013 06:17:13 PM (13 years ago)
Author:
nacin
Message:

Only enforce disk free space checks when doing background updates.

see #25652.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/file.php

    r25831 r25869  
    623623     * Require we have enough space to unzip the file and copy its contents, with a 10% buffer.
    624624     */
    625     $available_space = @disk_free_space( WP_CONTENT_DIR );
    626     if ( $available_space && ( $uncompressed_size * 2.1 ) > $available_space )
    627         return new WP_Error( 'disk_full_unzip_file', __( 'Could not copy files. You may have run out of disk space.' ), compact( 'uncompressed_size', 'available_space' ) );
     625    if ( defined( 'DOING_CRON' ) && DOING_CRON ) {
     626        $available_space = @disk_free_space( WP_CONTENT_DIR );
     627        if ( $available_space && ( $uncompressed_size * 2.1 ) > $available_space )
     628            return new WP_Error( 'disk_full_unzip_file', __( 'Could not copy files. You may have run out of disk space.' ), compact( 'uncompressed_size', 'available_space' ) );
     629    }
    628630
    629631    $needed_dirs = array_unique($needed_dirs);
     
    723725     * Require we have enough space to unzip the file and copy its contents, with a 10% buffer.
    724726     */
    725     $available_space = @disk_free_space( WP_CONTENT_DIR );
    726     if ( $available_space && ( $uncompressed_size * 2.1 ) > $available_space )
    727         return new WP_Error( 'disk_full_unzip_file', __( 'Could not copy files. You may have run out of disk space.' ), compact( 'uncompressed_size', 'available_space' ) );
     727    if ( defined( 'DOING_CRON' ) && DOING_CRON ) {
     728        $available_space = @disk_free_space( WP_CONTENT_DIR );
     729        if ( $available_space && ( $uncompressed_size * 2.1 ) > $available_space )
     730            return new WP_Error( 'disk_full_unzip_file', __( 'Could not copy files. You may have run out of disk space.' ), compact( 'uncompressed_size', 'available_space' ) );
     731    }
    728732
    729733    $needed_dirs = array_unique($needed_dirs);
Note: See TracChangeset for help on using the changeset viewer.