WordPress.org

Make WordPress Core

Changeset 25811


Ignore:
Timestamp:
10/16/2013 03:19:59 PM (8 years ago)
Author:
dd32
Message:

Avoid a few PHP Warnings when files don't exist and use a better method to locate the local filepath.
See #18201

File:
1 edited

Legend:

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

    r25806 r25811  
    755755                continue;
    756756
    757             if ( md5_file( ABSPATH . $file ) == $checksum )
     757            if ( file_exists( ABSPATH . $file ) && md5_file( ABSPATH . $file ) == $checksum )
    758758                $skip[] = $file;
    759759            else
     
    766766        $total_size = 0;
    767767        // Find the local version of the working directory
    768         $working_dir_local = str_replace( trailingslashit( $wp_filesystem->wp_content_dir() ), trailingslashit( WP_CONTENT_DIR ), $from . $distro );
    769         foreach ( $failed as $file )
    770             $total_size += filesize( $working_dir_local . '/' . $file );
     768        $working_dir_local = WP_CONTENT_DIR . '/upgrade/' . basename( $from ) . $distro;
     769        foreach ( $failed as $file ) {
     770            if ( file_exists( $working_dir_local . $file ) )
     771                $total_size += filesize( $working_dir_local . $file );
     772        }
    771773
    772774        // If we don't have enough free space, it isn't worth trying again.
Note: See TracChangeset for help on using the changeset viewer.