Make WordPress Core

Changeset 38730


Ignore:
Timestamp:
10/05/2016 03:50:54 AM (8 years ago)
Author:
dd32
Message:

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

Location:
trunk/src/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-http-requests-response.php

    r38164 r38730  
    6666     * @access public
    6767     *
    68      * @return array Map of header name to header value.
     68     * @see \Requests_Utility_CaseInsensitiveDictionary
     69     *
     70     * @return \Requests_Utility_CaseInsensitiveDictionary Map of header name to header value.
    6971     */
    7072    public function get_headers() {
    71         // Ensure headers remain case-insensitive
     73        // Ensure headers remain case-insensitive.
    7274        $converted = new Requests_Utility_CaseInsensitiveDictionary();
    7375
     
    7577            if ( count( $value ) === 1 ) {
    7678                $converted[ $key ] = $value[0];
    77             }
    78             else {
     79            } else {
    7980                $converted[ $key ] = $value;
    8081            }
  • trunk/src/wp-includes/http.php

    r38726 r38730  
    209209 *
    210210 * @since 2.7.0
     211 * @since 4.6.0 Return value changed from an array to an Requests_Utility_CaseInsensitiveDictionary instance.
     212 *
     213 * @see \Requests_Utility_CaseInsensitiveDictionary
    211214 *
    212215 * @param array $response HTTP response.
    213  * @return array The headers of the response. Empty array if incorrect parameter given.
     216 * @return array|\Requests_Utility_CaseInsensitiveDictionary The headers of the response. Empty array if incorrect parameter given.
    214217 */
    215218function wp_remote_retrieve_headers( $response ) {
Note: See TracChangeset for help on using the changeset viewer.