WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/25/2016 02:23:18 AM (4 years ago)
Author:
dd32
Message:

Upgrade: Don't fail a core update just because readme.html or license.txt couldn't be modified.

A number of locked down installs remove readme.html or make it inaccessible which would result in an update failure.

Props polevaultweb for the initial patch.
Fixes #31420.

File:
1 edited

Legend:

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

    r38379 r38898  
    908908                if ( ! file_exists( $working_dir_local . $file ) )
    909909                    continue;
     910                if ( '.' === dirname( $file ) && in_array( pathinfo( $file, PATHINFO_EXTENSION ), array( 'html', 'txt' ) ) )
     911                    continue;
    910912                if ( md5_file( ABSPATH . $file ) === $checksum )
    911913                    $skip[] = $file;
     
    969971            if ( ! file_exists( $working_dir_local . $file ) )
    970972                continue;
     973            if ( '.' === dirname( $file ) && in_array( pathinfo( $file, PATHINFO_EXTENSION ), array( 'html', 'txt' ) ) ) {
     974                $skip[] = $file;
     975                continue;
     976            }
    971977            if ( file_exists( ABSPATH . $file ) && md5_file( ABSPATH . $file ) == $checksum )
    972978                $skip[] = $file;
Note: See TracChangeset for help on using the changeset viewer.