Make WordPress Core

Changeset 39687


Ignore:
Timestamp:
01/05/2017 06:12:03 AM (8 years ago)
Author:
dd32
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/update-core.php

    r39520 r39687  
    836836
    837837
    838     /**
    839      * Import $wp_version, $required_php_version, and $required_mysql_version from the new version
    840      * $wp_filesystem->wp_content_dir() returned unslashed pre-2.8
     838    /*
     839     * Import $wp_version, $required_php_version, and $required_mysql_version from the new version.
     840     * DO NOT globalise any variables imported from `version-current.php` in this function.
    841841     *
    842      * @global string $wp_version
    843      * @global string $required_php_version
    844      * @global string $required_mysql_version
     842     * BC Note: $wp_filesystem->wp_content_dir() returned unslashed pre-2.8
    845843     */
    846     global $wp_version, $required_php_version, $required_mysql_version;
    847 
    848844    $versions_file = trailingslashit( $wp_filesystem->wp_content_dir() ) . 'upgrade/version-current.php';
    849845    if ( ! $wp_filesystem->copy( $from . $distro . 'wp-includes/version.php', $versions_file ) ) {
     
    858854    $php_version    = phpversion();
    859855    $mysql_version  = $wpdb->db_version();
    860     $old_wp_version = $wp_version; // The version of WordPress we're updating from
     856    $old_wp_version = $GLOBALS['wp_version']; // The version of WordPress we're updating from
    861857    $development_build = ( false !== strpos( $old_wp_version . $wp_version, '-' )  ); // a dash in the version indicates a Development release
    862858    $php_compat     = version_compare( $php_version, $required_php_version, '>=' );
Note: See TracChangeset for help on using the changeset viewer.