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/includes/class-wp-automatic-updater.php

    r38307 r38459  
    372372         * @since 3.7.0
    373373         * @access public
    374          *
    375          * @global wpdb   $wpdb
    376          * @global string $wp_version
    377374         */
    378375        public function run() {
    379                 global $wpdb, $wp_version;
    380 
    381376                if ( $this->is_disabled() )
    382377                        return;
     
    458453                // Send debugging email to all development installs.
    459454                if ( ! empty( $this->update_results ) ) {
    460                         $development_version = false !== strpos( $wp_version, '-' );
     455                        $development_version = false !== strpos( get_bloginfo( 'version' ), '-' );
    461456
    462457                        /**
     
    495490         * @access protected
    496491         *
    497          * @global string $wp_version
    498          *
    499492         * @param object $update_result The result of the core update. Includes the update offer and result.
    500493         */
    501494        protected function after_core_update( $update_result ) {
    502                 global $wp_version;
     495                $wp_version = get_bloginfo( 'version' );
    503496
    504497                $core_update = $update_result->item;
     
    585578         * @access protected
    586579         *
    587          * @global string $wp_version
    588          *
    589580         * @param string $type        The type of email to send. Can be one of 'success', 'fail', 'manual', 'critical'.
    590581         * @param object $core_update The update offer that was attempted.
     
    723714                if ( 'critical' == $type && is_wp_error( $result ) ) {
    724715                        $body .= "\n***\n\n";
    725                         $body .= sprintf( __( 'Your site was running version %s.' ), $GLOBALS['wp_version'] );
     716                        $body .= sprintf( __( 'Your site was running version %s.' ), get_bloginfo( 'version' ) );
    726717                        $body .= ' ' . __( 'We have some data that describes the error your site encountered.' );
    727718                        $body .= ' ' . __( 'Your hosting company, support forum volunteers, or a friendly developer may be able to use this information to help you:' );
Note: See TracChangeset for help on using the changeset viewer.