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
git-svn-id: http://core.svn.wordpress.org/trunk@21230 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
0230a753ec
commit
6f29700fdb
|
@ -382,18 +382,18 @@ class WP_Http {
|
|||
|
||||
list($key, $value) = explode(':', $tempheader, 2);
|
||||
|
||||
if ( !empty( $value ) ) {
|
||||
$key = strtolower( $key );
|
||||
if ( isset( $newheaders[$key] ) ) {
|
||||
if ( !is_array($newheaders[$key]) )
|
||||
$newheaders[$key] = array($newheaders[$key]);
|
||||
$newheaders[$key][] = trim( $value );
|
||||
} else {
|
||||
$newheaders[$key] = trim( $value );
|
||||
}
|
||||
if ( 'set-cookie' == $key )
|
||||
$cookies[] = new WP_Http_Cookie( $value );
|
||||
$key = strtolower( $key );
|
||||
$value = trim( $value );
|
||||
|
||||
if ( isset( $newheaders[ $key ] ) ) {
|
||||
if ( ! is_array( $newheaders[ $key ] ) )
|
||||
$newheaders[$key] = array( $newheaders[ $key ] );
|
||||
$newheaders[ $key ][] = $value;
|
||||
} else {
|
||||
$newheaders[ $key ] = $value;
|
||||
}
|
||||
if ( 'set-cookie' == $key )
|
||||
$cookies[] = new WP_Http_Cookie( $value );
|
||||
}
|
||||
|
||||
return array('response' => $response, 'headers' => $newheaders, 'cookies' => $cookies);
|
||||
|
|
Loading…
Reference in New Issue