WordPress.org

Make WordPress Core

Changeset 25778


Ignore:
Timestamp:
10/14/2013 09:14:39 PM (5 years ago)
Author:
nacin
Message:

Account for the possible failure of disk_free_space() in update_core().

see #22704, #25576.

File:
1 edited

Legend:

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

    r25772 r25778  
    741741            $total_size += filesize( $working_dir_local . '/' . $file );
    742742
    743         // If we don't have enough free space, it isn't worth trying again
    744         if ( $total_size >= disk_free_space( ABSPATH ) ) {
     743        // If we don't have enough free space, it isn't worth trying again.
     744        // Unlikely to be hit due to the check in unzip_file().
     745        $available_space = disk_free_space( ABSPATH );
     746        if ( $available_space && $total_size >= $available_space ) {
    745747            $result = new WP_Error( 'disk_full', __( 'There is not enough free disk space to complete the update.' ), $to );
    746748        } else {
Note: See TracChangeset for help on using the changeset viewer.