HTTP API: Pass array-like object to http_api_debug.
This was mistakingly passing the Requests_Response object, which caused fatal errors with debugging tools. See #33055. Built from https://develop.svn.wordpress.org/trunk@37436 git-svn-id: http://core.svn.wordpress.org/trunk@37402 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
bdfd58c8cf
commit
6da21bc4f4
|
@ -349,6 +349,9 @@ class WP_Http {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$response = Requests::request( $url, $headers, $data, $type, $options );
|
$response = Requests::request( $url, $headers, $data, $type, $options );
|
||||||
|
|
||||||
|
// Convert the response into an array
|
||||||
|
$response = new WP_HTTP_Requests_Response( $response, $r['filename'] );
|
||||||
}
|
}
|
||||||
catch ( Requests_Exception $e ) {
|
catch ( Requests_Exception $e ) {
|
||||||
$response = new WP_Error( 'http_request_failed', $e->getMessage() );
|
$response = new WP_Error( 'http_request_failed', $e->getMessage() );
|
||||||
|
@ -382,19 +385,16 @@ class WP_Http {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Convert the response into an array
|
|
||||||
$data = new WP_HTTP_Requests_Response( $response, $r['filename'] );
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filter the HTTP API response immediately before the response is returned.
|
* Filter the HTTP API response immediately before the response is returned.
|
||||||
*
|
*
|
||||||
* @since 2.9.0
|
* @since 2.9.0
|
||||||
*
|
*
|
||||||
* @param array $data HTTP response.
|
* @param array $response HTTP response.
|
||||||
* @param array $r HTTP request arguments.
|
* @param array $r HTTP request arguments.
|
||||||
* @param string $url The request URL.
|
* @param string $url The request URL.
|
||||||
*/
|
*/
|
||||||
return apply_filters( 'http_response', $data, $r, $url );
|
return apply_filters( 'http_response', $response, $r, $url );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.6-alpha-37435';
|
$wp_version = '4.6-alpha-37436';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue