WordPress.org

Make WordPress Core

Changeset 25831


Ignore:
Timestamp:
10/17/13 18:39:04 (4 years ago)
Author:
dd32
Message:

Silence PHP warnings from disk_free_space(). disk_free_space() will produce a warning in error conditions in addition to returning false, this includes a case where the bytes free is greater than PHP_INT_MAX (which is a error condition we don't need to check).
See #25576, #22704

Location:
trunk/src/wp-admin/includes
Files:
2 edited

Legend:

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

    r25806 r25831  
    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 ); 
     625    $available_space = @disk_free_space( WP_CONTENT_DIR ); 
    626626    if ( $available_space && ( $uncompressed_size * 2.1 ) > $available_space ) 
    627627        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' ) ); 
     
    723723     * Require we have enough space to unzip the file and copy its contents, with a 10% buffer. 
    724724     */ 
    725     $available_space = disk_free_space( WP_CONTENT_DIR ); 
     725    $available_space = @disk_free_space( WP_CONTENT_DIR ); 
    726726    if ( $available_space && ( $uncompressed_size * 2.1 ) > $available_space ) 
    727727        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' ) ); 
  • trunk/src/wp-admin/includes/update-core.php

    r25811 r25831  
    774774        // If we don't have enough free space, it isn't worth trying again. 
    775775        // Unlikely to be hit due to the check in unzip_file(). 
    776         $available_space = disk_free_space( ABSPATH ); 
     776        $available_space = @disk_free_space( ABSPATH ); 
    777777        if ( $available_space && $total_size >= $available_space ) { 
    778778            $result = new WP_Error( 'disk_full', __( 'There is not enough free disk space to complete the update.' ) ); 
Note: See TracChangeset for help on using the changeset viewer.