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:
Dion Hulse 2012-07-08 05:16:26 +00:00
parent 420c84a793
commit 77c54f2481
1 changed files with 11 additions and 11 deletions

View File

@ -382,19 +382,19 @@ class WP_Http {
list($key, $value) = explode(':', $tempheader, 2); list($key, $value) = explode(':', $tempheader, 2);
if ( !empty( $value ) ) {
$key = strtolower( $key ); $key = strtolower( $key );
$value = trim( $value );
if ( isset( $newheaders[ $key ] ) ) { if ( isset( $newheaders[ $key ] ) ) {
if ( ! is_array( $newheaders[ $key ] ) ) if ( ! is_array( $newheaders[ $key ] ) )
$newheaders[$key] = array( $newheaders[ $key ] ); $newheaders[$key] = array( $newheaders[ $key ] );
$newheaders[$key][] = trim( $value ); $newheaders[ $key ][] = $value;
} else { } else {
$newheaders[$key] = trim( $value ); $newheaders[ $key ] = $value;
} }
if ( 'set-cookie' == $key ) if ( 'set-cookie' == $key )
$cookies[] = new WP_Http_Cookie( $value ); $cookies[] = new WP_Http_Cookie( $value );
} }
}
return array('response' => $response, 'headers' => $newheaders, 'cookies' => $cookies); return array('response' => $response, 'headers' => $newheaders, 'cookies' => $cookies);
} }