Fix WP_Http_Streams to return a single set of headers in the event of redirections. Fixes #11555

git-svn-id: http://svn.automattic.com/wordpress/trunk@12746 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
dd32 2010-01-17 08:05:58 +00:00
parent 651925fe74
commit 8c109d738b
1 changed files with 9 additions and 0 deletions

View File

@ -424,6 +424,15 @@ class WP_Http {
$response = array('code' => 0, 'message' => '');
// If a redirection has taken place, The headers for each page request may have been passed.
// In this case, determine the final HTTP header and parse from there.
for ( $i = count($headers)-1; $i >= 0; $i-- ) {
if ( false === strpos($headers[$i], ':') ) {
$headers = array_splice($headers, $i);
break;
}
}
$cookies = array();
$newheaders = array();
foreach ( $headers as $tempheader ) {