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:
dd32 2012-07-08 05:16:26 +00:00
parent 0230a753ec
commit 6f29700fdb
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);
} }