Minor tidy up from merge of changes to BackPress.

git-svn-id: http://svn.automattic.com/wordpress/trunk@11237 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
westi 2009-05-07 21:49:10 +00:00
parent 79c7fb33fa
commit b8bc0b796a
1 changed files with 7 additions and 6 deletions

View File

@ -418,12 +418,11 @@ class WP_Http {
if ( !empty( $value ) ) { if ( !empty( $value ) ) {
$key = strtolower( $key ); $key = strtolower( $key );
if ( isset( $newheaders[$key] ) ) {
if ( isset( $newheaders[$key] ) )
$newheaders[$key] = array( $newheaders[$key], trim( $value ) ); $newheaders[$key] = array( $newheaders[$key], trim( $value ) );
else } else {
$newheaders[$key] = trim( $value ); $newheaders[$key] = trim( $value );
}
if ( 'set-cookie' == strtolower( $key ) ) if ( 'set-cookie' == strtolower( $key ) )
$cookies[] = new WP_Http_Cookie( $value ); $cookies[] = new WP_Http_Cookie( $value );
} }
@ -448,8 +447,9 @@ class WP_Http {
function buildCookieHeader( &$r ) { function buildCookieHeader( &$r ) {
if ( ! empty($r['cookies']) ) { if ( ! empty($r['cookies']) ) {
$cookies_header = ''; $cookies_header = '';
foreach ( (array) $r['cookies'] as $cookie ) foreach ( (array) $r['cookies'] as $cookie ) {
$cookies_header .= $cookie->getHeaderValue() . '; '; $cookies_header .= $cookie->getHeaderValue() . '; ';
}
$cookies_header = substr( $cookies_header, 0, -2 ); $cookies_header = substr( $cookies_header, 0, -2 );
$r['headers']['cookie'] = $cookies_header; $r['headers']['cookie'] = $cookies_header;
} }
@ -1292,8 +1292,9 @@ class WP_Http_Curl {
if ( !empty( $r['headers'] ) ) { if ( !empty( $r['headers'] ) ) {
// cURL expects full header strings in each element // cURL expects full header strings in each element
$headers = array(); $headers = array();
foreach ( $r['headers'] as $name => $value ) foreach ( $r['headers'] as $name => $value ) {
$headers[] = "{$name}: $value"; $headers[] = "{$name}: $value";
}
curl_setopt( $handle, CURLOPT_HTTPHEADER, $headers ); curl_setopt( $handle, CURLOPT_HTTPHEADER, $headers );
} }