Make WordPress Core


Ignore:
Timestamp:
08/31/2016 05:48:49 AM (10 years ago)
Author:
wonderboymusic
Message:

General: use get_bloginfo( 'version' ) instead of global $wp_version in several locations - excluding those locations which reload version.php mid-flight.

See #37699.

File:
1 edited

Legend:

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

    r38411 r38459  
    2727 * @global string $wp_local_package
    2828 * @global wpdb   $wpdb
    29  * @global string $wp_version
    3029 *
    3130 * @staticvar bool $first_pass
    … …  
    3433 */
    3534function list_core_update( $update ) {
    36         global $wp_local_package, $wpdb, $wp_version;
     35        global $wp_local_package, $wpdb;
    3736        static $first_pass = true;
     37
     38        $wp_version = get_bloginfo( 'version' );
    3839
    3940        if ( 'en_US' == $update->locale && 'en_US' == get_locale() )
    … …  
    150151 * @since 2.7.0
    151152 *
    152  * @global string $wp_version
    153153 * @global string $required_php_version
    154154 * @global string $required_mysql_version
    155155 */
    156156function core_upgrade_preamble() {
    157         global $wp_version, $required_php_version, $required_mysql_version;
    158 
     157        global $required_php_version, $required_mysql_version;
     158
     159        $wp_version = get_bloginfo( 'version' );
    159160        $updates = get_core_updates();
    160161
    … …  
    212213}
    213214
    214 /**
    215  *
    216  * @global string $wp_version
    217  */
    218215function list_plugin_updates() {
    219         global $wp_version;
    220 
    221         $cur_wp_version = preg_replace('/-.*$/', '', $wp_version);
     216        $wp_version = get_bloginfo( 'version' );
     217        $cur_wp_version = preg_replace( '/-.*$/', '', $wp_version );
    222218
    223219        require_once(ABSPATH . 'wp-admin/includes/plugin-install.php');
Note: See TracChangeset for help on using the changeset viewer.