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: https://develop.svn.wordpress.org/trunk@21230 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
420c84a793
commit
77c54f2481
|
@ -382,19 +382,19 @@ 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 );
|
||||
$value = trim( $value );
|
||||
|
||||
if ( isset( $newheaders[ $key ] ) ) {
|
||||
if ( ! is_array( $newheaders[ $key ] ) )
|
||||
$newheaders[$key] = array( $newheaders[ $key ] );
|
||||
$newheaders[ $key ][] = $value;
|
||||
} else {
|
||||
$newheaders[$key] = trim( $value );
|
||||
$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