From 2b788037c733c2d6186362c034981abc6f77c500 Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Tue, 25 Oct 2016 02:24:31 +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. Built from https://develop.svn.wordpress.org/trunk@38898 git-svn-id: http://core.svn.wordpress.org/trunk@38841 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/update-core.php | 6 ++++++ wp-includes/version.php | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/wp-admin/includes/update-core.php b/wp-admin/includes/update-core.php index 8866d09896..342e7c326b 100644 --- a/wp-admin/includes/update-core.php +++ b/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 diff --git a/wp-includes/version.php b/wp-includes/version.php index c375cfe546..5bb252554d 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.7-alpha-38897'; +$wp_version = '4.7-alpha-38898'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.