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.


git-svn-id: https://develop.svn.wordpress.org/trunk@38898 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dion Hulse 2016-10-25 02:23:18 +00:00
parent 277bb681d7
commit 7aa09b6d24
1 changed files with 6 additions and 0 deletions

View File

@ -907,6 +907,8 @@ function update_core($from, $to) {
continue;
if ( ! file_exists( $working_dir_local . $file ) )
continue;
if ( '.' === dirname( $file ) && in_array( pathinfo( $file, PATHINFO_EXTENSION ), array( 'html', 'txt' ) ) )
continue;
if ( md5_file( ABSPATH . $file ) === $checksum )
$skip[] = $file;
else
@ -968,6 +970,10 @@ function update_core($from, $to) {
continue;
if ( ! file_exists( $working_dir_local . $file ) )
continue;
if ( '.' === dirname( $file ) && in_array( pathinfo( $file, PATHINFO_EXTENSION ), array( 'html', 'txt' ) ) ) {
$skip[] = $file;
continue;
}
if ( file_exists( ABSPATH . $file ) && md5_file( ABSPATH . $file ) == $checksum )
$skip[] = $file;
else