WordPress.org

Make WordPress Core


Ignore:
Timestamp:
08/31/2016 05:48:49 AM (3 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-includes/class-http.php

    r38430 r38459  
    102102     * @since 2.7.0
    103103     *
    104      * @global string $wp_version
    105      *
    106104     * @param string       $url  The request URL.
    107105     * @param string|array $args {
     
    117115     *                                             Default '1.0'.
    118116     *     @type string       $user-agent          User-agent value sent.
    119      *                                             Default WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' ).
     117     *                                             Default WordPress/' . get_bloginfo( 'version' ) . '; ' . get_bloginfo( 'url' ).
    120118     *     @type bool         $reject_unsafe_urls  Whether to pass URLs through wp_http_validate_url().
    121119     *                                             Default false.
     
    149147     */
    150148    public function request( $url, $args = array() ) {
    151         global $wp_version;
    152 
    153149        $defaults = array(
    154150            'method' => 'GET',
     
    186182             * @param string $user_agent WordPress user agent string.
    187183             */
    188             'user-agent' => apply_filters( 'http_headers_useragent', 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' ) ),
     184            'user-agent' => apply_filters( 'http_headers_useragent', 'WordPress/' . get_bloginfo( 'version' ) . '; ' . get_bloginfo( 'url' ) ),
    189185            /**
    190186             * Filters whether to pass URLs through wp_http_validate_url() in an HTTP request.
Note: See TracChangeset for help on using the changeset viewer.