WordPress.org

Make WordPress Core

Changeset 21230


Ignore:
Timestamp:
07/08/2012 05:16:26 AM (6 years ago)
Author:
dd32
Message:

WP_HTTP: Remove a empty() check that would never be empty due to the format of HTTP Headers, value would always contain at least a space followed by the value. See #14184

File:
1 edited

Legend:

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

    r21227 r21230  
    383383            list($key, $value) = explode(':', $tempheader, 2);
    384384
    385             if ( !empty( $value ) ) {
    386                 $key = strtolower( $key );
    387                 if ( isset( $newheaders[$key] ) ) {
    388                     if ( !is_array($newheaders[$key]) )
    389                         $newheaders[$key] = array($newheaders[$key]);
    390                     $newheaders[$key][] = trim( $value );
    391                 } else {
    392                     $newheaders[$key] = trim( $value );
    393                 }
    394                 if ( 'set-cookie' == $key )
    395                     $cookies[] = new WP_Http_Cookie( $value );
     385            $key = strtolower( $key );
     386            $value = trim( $value );
     387
     388            if ( isset( $newheaders[ $key ] ) ) {
     389                if ( ! is_array( $newheaders[ $key ] ) )
     390                    $newheaders[$key] = array( $newheaders[ $key ] );
     391                $newheaders[ $key ][] = $value;
     392            } else {
     393                $newheaders[ $key ] = $value;
    396394            }
     395            if ( 'set-cookie' == $key )
     396                $cookies[] = new WP_Http_Cookie( $value );
    397397        }
    398398
Note: See TracChangeset for help on using the changeset viewer.