From 7aa09b6d2424beb8c850c9fa5b50cc0d0ba36e5f Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Tue, 25 Oct 2016 02:23:18 +0000 Subject: [PATCH] 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 --- src/wp-admin/includes/update-core.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/wp-admin/includes/update-core.php b/src/wp-admin/includes/update-core.php index 8866d09896..342e7c326b 100644 --- a/src/wp-admin/includes/update-core.php +++ b/src/wp-admin/includes/update-core.php @@ -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