Make WordPress Core

Ticket #37722: 37722.3.diff

File 37722.3.diff, 1.1 KB (added by sudar, 8 years ago)
  • wp-includes/class-wp-http-requests-response.php

     
    6363         * Retrieves headers associated with the response.
    6464         *
    6565         * @since 4.6.0
     66         * @since 4.7.0 Return value changed to Requests_Utility_CaseInsensitiveDictionary from array.
    6667         * @access public
    6768         *
    68          * @return array Map of header name to header value.
     69         * @see \Requests_Utility_CaseInsensitiveDictionary
     70         *
     71         * @return \Requests_Utility_CaseInsensitiveDictionary Map of header name to header value.
    6972         */
    7073        public function get_headers() {
    71                 // Ensure headers remain case-insensitive
     74                // Ensure headers remain case-insensitive.
    7275                $converted = new Requests_Utility_CaseInsensitiveDictionary();
    7376
    7477                foreach ( $this->response->headers->getAll() as $key => $value ) {
    7578                        if ( count( $value ) === 1 ) {
    7679                                $converted[ $key ] = $value[0];
    77                         }
    78                         else {
     80                        } else {
    7981                                $converted[ $key ] = $value;
    8082                        }
    8183                }