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

See #37699.


git-svn-id: https://develop.svn.wordpress.org/trunk@38459 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor
2016-08-31 05:48:49 +00:00
parent 2078dda129
commit 1825eff382
22 changed files with 51 additions and 107 deletions

View File

@@ -101,8 +101,6 @@ class WP_Http {
* @access public
* @since 2.7.0
*
* @global string $wp_version
*
* @param string $url The request URL.
* @param string|array $args {
* Optional. Array or string of HTTP request arguments.
@@ -116,7 +114,7 @@ class WP_Http {
* @type string $httpversion Version of the HTTP protocol to use. Accepts '1.0' and '1.1'.
* Default '1.0'.
* @type string $user-agent User-agent value sent.
* Default WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' ).
* Default WordPress/' . get_bloginfo( 'version' ) . '; ' . get_bloginfo( 'url' ).
* @type bool $reject_unsafe_urls Whether to pass URLs through wp_http_validate_url().
* Default false.
* @type bool $blocking Whether the calling code requires the result of the request.
@@ -148,8 +146,6 @@ class WP_Http {
* A WP_Error instance upon error.
*/
public function request( $url, $args = array() ) {
global $wp_version;
$defaults = array(
'method' => 'GET',
/**
@@ -185,7 +181,7 @@ class WP_Http {
*
* @param string $user_agent WordPress user agent string.
*/
'user-agent' => apply_filters( 'http_headers_useragent', 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' ) ),
'user-agent' => apply_filters( 'http_headers_useragent', 'WordPress/' . get_bloginfo( 'version' ) . '; ' . get_bloginfo( 'url' ) ),
/**
* Filters whether to pass URLs through wp_http_validate_url() in an HTTP request.
*