Revert "wp++"

This reverts commit 89fcc36fb1.
This commit is contained in:
Nikolai R Kristiansen committed 2017-04-26 22:03:15 +02:00
1 parent 9737a7c310
commit 358542eef5
1078 files changed
+33799 -65099

No files matched your search

+9 -8
View File
@@ -101,6 +101,8 @@ 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.
@@ -114,7 +116,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/' . get_bloginfo( 'version' ) . '; ' . get_bloginfo( 'url' ).
* Default WordPress/' . $wp_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.
@@ -146,6 +148,8 @@ class WP_Http {
* A WP_Error instance upon error.
*/
public function request( $url, $args = array() ) {
global $wp_version;
$defaults = array(
'method' => 'GET',
/**
@@ -181,7 +185,7 @@ class WP_Http {
*
* @param string $user_agent WordPress user agent string.
*/
'user-agent' => apply_filters( 'http_headers_useragent', 'WordPress/' . get_bloginfo( 'version' ) . '; ' . get_bloginfo( 'url' ) ),
'user-agent' => apply_filters( 'http_headers_useragent', 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' ) ),
/**
* Filters whether to pass URLs through wp_http_validate_url() in an HTTP request.
*
@@ -300,7 +304,7 @@ class WP_Http {
'timeout' => $r['timeout'],
'useragent' => $r['user-agent'],
'blocking' => $r['blocking'],
'hooks' => new WP_HTTP_Requests_Hooks( $url, $r ),
'hooks' => new Requests_Hooks(),
);
// Ensure redirects follow browser behaviour.
@@ -328,7 +332,6 @@ class WP_Http {
// SSL certificate handling
if ( ! $r['sslverify'] ) {
$options['verify'] = false;
$options['verifyname'] = false;
} else {
$options['verify'] = $r['sslcertificates'];
}
@@ -359,8 +362,8 @@ class WP_Http {
}
}
// Avoid issues where mbstring.func_overload is enabled
mbstring_binary_safe_encoding();
// Work around a bug in Requests when the path starts with // See https://github.com/rmccue/Requests/issues/231
$url = preg_replace( '!^(\w+://[^/]+)//(.*)$!i', '$1/$2', $url );
try {
$requests_response = Requests::request( $url, $headers, $data, $type, $options );
@@ -376,8 +379,6 @@ class WP_Http {
$response = new WP_Error( 'http_request_failed', $e->getMessage() );
}
reset_mbstring_encoding();
/**
* Fires after an HTTP API response is received and before the response is returned.
*