From 93f7f904ec32a12531d25b3a76f6fdb974507d43 Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Wed, 5 Oct 2016 03:51:28 +0000 Subject: [PATCH] HTTP: Document that the return value of `wp_remote_retrieve_headers()` changed from a simple array to an object which implements ArrayAccess. Props mrahmadawais, sudar, swissspidy. Fixes #37722 Built from https://develop.svn.wordpress.org/trunk@38730 git-svn-id: http://core.svn.wordpress.org/trunk@38673 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-http-requests-response.php | 9 +++++---- wp-includes/http.php | 5 ++++- wp-includes/version.php | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/wp-includes/class-wp-http-requests-response.php b/wp-includes/class-wp-http-requests-response.php index ab0a5cc056..660831919e 100644 --- a/wp-includes/class-wp-http-requests-response.php +++ b/wp-includes/class-wp-http-requests-response.php @@ -65,17 +65,18 @@ class WP_HTTP_Requests_Response extends WP_HTTP_Response { * @since 4.6.0 * @access public * - * @return array Map of header name to header value. + * @see \Requests_Utility_CaseInsensitiveDictionary + * + * @return \Requests_Utility_CaseInsensitiveDictionary Map of header name to header value. */ public function get_headers() { - // Ensure headers remain case-insensitive + // Ensure headers remain case-insensitive. $converted = new Requests_Utility_CaseInsensitiveDictionary(); foreach ( $this->response->headers->getAll() as $key => $value ) { if ( count( $value ) === 1 ) { $converted[ $key ] = $value[0]; - } - else { + } else { $converted[ $key ] = $value; } } diff --git a/wp-includes/http.php b/wp-includes/http.php index 62638d5474..ff89672ec1 100644 --- a/wp-includes/http.php +++ b/wp-includes/http.php @@ -208,9 +208,12 @@ function wp_remote_head($url, $args = array()) { * Retrieve only the headers from the raw response. * * @since 2.7.0 + * @since 4.6.0 Return value changed from an array to an Requests_Utility_CaseInsensitiveDictionary instance. + * + * @see \Requests_Utility_CaseInsensitiveDictionary * * @param array $response HTTP response. - * @return array The headers of the response. Empty array if incorrect parameter given. + * @return array|\Requests_Utility_CaseInsensitiveDictionary The headers of the response. Empty array if incorrect parameter given. */ function wp_remote_retrieve_headers( $response ) { if ( is_wp_error( $response ) || ! isset( $response['headers'] ) ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index 03cc7a1e5a..20cf64db69 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.7-alpha-38729'; +$wp_version = '4.7-alpha-38730'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.