From 2ed0d6cae0eb8c8c0f8743973ef4148cb0990a8f Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Wed, 8 Oct 2014 05:18:22 +0000 Subject: [PATCH] Return the correct server response for the 'message' response field from the server. Previously this would use the generic message corresponding to the response code, which isn't always accurate. Since we're already parsing the headers, we can simply return that directly (This also has the benefit that it's the same code for both Streams and Curl header handling). Fixes #28919 git-svn-id: https://develop.svn.wordpress.org/trunk@29848 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/class-http.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/wp-includes/class-http.php b/src/wp-includes/class-http.php index d925a07b54..3cfdee4a93 100644 --- a/src/wp-includes/class-http.php +++ b/src/wp-includes/class-http.php @@ -1442,10 +1442,6 @@ class WP_Http_Curl { } } - $response = array(); - $response['code'] = curl_getinfo( $handle, CURLINFO_HTTP_CODE ); - $response['message'] = get_status_header_desc($response['code']); - curl_close( $handle ); if ( $r['stream'] ) @@ -1454,7 +1450,7 @@ class WP_Http_Curl { $response = array( 'headers' => $theHeaders['headers'], 'body' => null, - 'response' => $response, + 'response' => $theHeaders['response'], 'cookies' => $theHeaders['cookies'], 'filename' => $r['filename'] );