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:
parent
277bb681d7
commit
7aa09b6d24
|
@ -907,6 +907,8 @@ function update_core($from, $to) {
|
||||||
continue;
|
continue;
|
||||||
if ( ! file_exists( $working_dir_local . $file ) )
|
if ( ! file_exists( $working_dir_local . $file ) )
|
||||||
continue;
|
continue;
|
||||||
|
if ( '.' === dirname( $file ) && in_array( pathinfo( $file, PATHINFO_EXTENSION ), array( 'html', 'txt' ) ) )
|
||||||
|
continue;
|
||||||
if ( md5_file( ABSPATH . $file ) === $checksum )
|
if ( md5_file( ABSPATH . $file ) === $checksum )
|
||||||
$skip[] = $file;
|
$skip[] = $file;
|
||||||
else
|
else
|
||||||
|
@ -968,6 +970,10 @@ function update_core($from, $to) {
|
||||||
continue;
|
continue;
|
||||||
if ( ! file_exists( $working_dir_local . $file ) )
|
if ( ! file_exists( $working_dir_local . $file ) )
|
||||||
continue;
|
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 )
|
if ( file_exists( ABSPATH . $file ) && md5_file( ABSPATH . $file ) == $checksum )
|
||||||
$skip[] = $file;
|
$skip[] = $file;
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue