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.


git-svn-id: https://develop.svn.wordpress.org/trunk@37436 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan McCue 2016-05-16 06:11:58 +00:00
parent f805805f44
commit 62dc6e6dfa
1 changed files with 7 additions and 7 deletions

View File

@ -349,6 +349,9 @@ class WP_Http {
try {
$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 ) {
$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.
*
* @since 2.9.0
*
* @param array $data HTTP response.
* @param array $r HTTP request arguments.
* @param string $url The request URL.
* @param array $response HTTP response.
* @param array $r HTTP request arguments.
* @param string $url The request URL.
*/
return apply_filters( 'http_response', $data, $r, $url );
return apply_filters( 'http_response', $response, $r, $url );
}
/**