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

git-svn-id: https://develop.svn.wordpress.org/trunk@12746 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dion Hulse 2010-01-17 08:05:58 +00:00
parent e988455155
commit ebcae35244
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 ) {