Make WordPress Core


Ignore:
Timestamp:
10/15/2013 11:02:28 PM (13 years ago)
Author:
nacin
Message:

Significantly simplify get_core_checksums(), as the caching and chunking was causing too much grief.

Make sure we only do our pre-flight is_writable check when the file exists.

see #18201. see #22704.

File:
1 edited

Legend:

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

    r25800 r25801  
    697697        // Check to see which files don't really need updating - only available for 3.7 and higher
    698698        if ( function_exists( 'get_core_checksums' ) ) {
    699                 $checksums = get_core_checksums( $wp_version );
    700                 if ( ! empty( $checksums[ $wp_version ] ) && is_array( $checksums[ $wp_version ] ) ) {
    701                         foreach( $checksums[ $wp_version ] as $file => $checksum ) {
     699                $checksums = get_core_checksums( $wp_version, isset( $wp_local_package ) ? $wp_local_package : 'en_US' );
     700                if ( is_array( current( $checksums ) ) ) // Compat code for 3.7-beta2
     701                        $checksums = current( $checksums );
     702                if ( is_array( $checksums ) ) {
     703                        foreach( $checksums as $file => $checksum ) {
    702704                                if ( 'wp-content' == substr( $file, 0, 10 ) )
    703705                                        continue;
    704                                 if ( file_exists( ABSPATH . $file ) && md5_file( ABSPATH . $file ) === $checksum )
     706                                if ( ! file_exists( ABSPATH . $file ) )
     707                                        continue;
     708                                if ( md5_file( ABSPATH . $file ) === $checksum )
    705709                                        $skip[] = $file;
    706710                                else
    … …  
    746750        $skip = array( 'wp-content' );
    747751        $failed = array();
    748         if ( ! empty( $checksums[ $wp_version ] ) && is_array( $checksums[ $wp_version ] ) ) {
    749                 foreach ( $checksums[ $wp_version ] as $file => $checksum ) {
     752        if ( is_array( $checksums ) ) {
     753                foreach ( $checksums as $file => $checksum ) {
    750754                        if ( 0 === strpos( $file, 'wp-content' ) )
    751755                                continue;
Note: See TracChangeset for help on using the changeset viewer.