Ticket #9395: 9395.diff
File 9395.diff, 1.3 KB (added by , 16 years ago) |
---|
-
wp-includes/http.php
403 403 404 404 $cookies = array(); 405 405 $newheaders = array(); 406 407 // first, process the HTTP status line 408 if ( false === strpos($headers[0], ':') ) { 409 $tempheader = array_shift($headers); 410 list( , $response_code, $response_msg) = explode(' ', $tempheader, 3); 411 $response['code'] = $response_code; 412 $response['message'] = $response_msg; 413 } 414 415 // combine any headers split over multiple lines 416 if ( sizeof($headers) > 2 ) 417 for ( $i=(sizeof($headers)-1); $i>=0; $i-- ) { 418 $c = substr($headers[$i], 0, 1); 419 if ($c == ' ' || $c == "\t") { 420 $headers[$i-1] = rtrim($headers[$i-1]) . ' ' . ltrim($headers[$i]); 421 unset($headers[$i]); 422 } 423 } 424 406 425 foreach ( $headers as $tempheader ) { 407 426 if ( empty($tempheader) ) 408 427 continue; 409 428 410 if ( false === strpos($tempheader, ':') ) {411 list( , $iResponseCode, $strResponseMsg) = explode(' ', $tempheader, 3);412 $response['code'] = $iResponseCode;413 $response['message'] = $strResponseMsg;414 continue;415 }416 417 429 list($key, $value) = explode(':', $tempheader, 2); 418 430 419 431 if ( !empty( $value ) ) {