Ticket #9395: http.diff
File http.diff, 1.2 KB (added by , 16 years ago) |
---|
-
http.php
404 404 405 405 $cookies = array(); 406 406 $newheaders = array(); 407 408 // first, process the HTTP status line 409 if ( false === strpos($headers[0], ':') ) { 410 $tempheader = array_shift($headers); 411 list( , $iResponseCode, $strResponseMsg) = explode(' ', $tempheader, 3); 412 $response['code'] = $iResponseCode; 413 $response['message'] = $strResponseMsg; 414 } 415 416 // combine any headers split over multiple lines 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 407 425 foreach ( $headers as $tempheader ) { 408 426 if ( empty($tempheader) ) 409 427 continue; 410 428 411 if ( false === strpos($tempheader, ':') ) {412 list( , $iResponseCode, $strResponseMsg) = explode(' ', $tempheader, 3);413 $response['code'] = $iResponseCode;414 $response['message'] = $strResponseMsg;415 continue;416 }417 418 429 list($key, $value) = explode(':', $tempheader, 2); 419 430 420 431 if ( !empty( $value ) ) {