Upgrade: Fix the installation of TwentySeventeen upon upgrade from an early version.

This reverts part of [31124] which incorrectly caused `$old_wp_version` to equal the version of WordPress being upgraded to due to global variable access changes.

See #38551, #30799.
Fixes #39138 for trunk.

Built from https://develop.svn.wordpress.org/trunk@39687


git-svn-id: http://core.svn.wordpress.org/trunk@39627 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dion Hulse 2017-01-05 06:13:41 +00:00
parent 5468850b10
commit b5dbe61dab
2 changed files with 6 additions and 10 deletions

View File

@ -835,16 +835,12 @@ function update_core($from, $to) {
}
/**
* Import $wp_version, $required_php_version, and $required_mysql_version from the new version
* $wp_filesystem->wp_content_dir() returned unslashed pre-2.8
/*
* Import $wp_version, $required_php_version, and $required_mysql_version from the new version.
* DO NOT globalise any variables imported from `version-current.php` in this function.
*
* @global string $wp_version
* @global string $required_php_version
* @global string $required_mysql_version
* BC Note: $wp_filesystem->wp_content_dir() returned unslashed pre-2.8
*/
global $wp_version, $required_php_version, $required_mysql_version;
$versions_file = trailingslashit( $wp_filesystem->wp_content_dir() ) . 'upgrade/version-current.php';
if ( ! $wp_filesystem->copy( $from . $distro . 'wp-includes/version.php', $versions_file ) ) {
$wp_filesystem->delete( $from, true );
@ -857,7 +853,7 @@ function update_core($from, $to) {
$php_version = phpversion();
$mysql_version = $wpdb->db_version();
$old_wp_version = $wp_version; // The version of WordPress we're updating from
$old_wp_version = $GLOBALS['wp_version']; // The version of WordPress we're updating from
$development_build = ( false !== strpos( $old_wp_version . $wp_version, '-' ) ); // a dash in the version indicates a Development release
$php_compat = version_compare( $php_version, $required_php_version, '>=' );
if ( file_exists( WP_CONTENT_DIR . '/db.php' ) && empty( $wpdb->is_mysql ) )

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.8-alpha-39686';
$wp_version = '4.8-alpha-39687';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.