WordPress.org

Make WordPress Core

Changeset 12746


Ignore:
Timestamp:
01/17/2010 08:05:58 AM (8 years ago)
Author:
dd32
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/http.php

    r12745 r12746  
    424424
    425425        $response = array('code' => 0, 'message' => '');
     426
     427        // If a redirection has taken place, The headers for each page request may have been passed.
     428        // In this case, determine the final HTTP header and parse from there.
     429        for ( $i = count($headers)-1; $i >= 0; $i-- ) {
     430            if ( false === strpos($headers[$i], ':') ) {
     431                $headers = array_splice($headers, $i);
     432                break;
     433            }
     434        }
    426435
    427436        $cookies = array();
Note: See TracChangeset for help on using the changeset viewer.