Changeset 13849 for trunk/wp-includes/class-http.php
- Timestamp:
- 03/28/2010 12:56:43 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/class-http.php
r13847 r13849 393 393 */ 394 394 function processResponse($strResponse) { 395 list($theHeaders, $theBody) = explode("\r\n\r\n", $strResponse, 2); 396 return array('headers' => $theHeaders, 'body' => $theBody); 395 $res = explode("\r\n\r\n", $strResponse, 2); 396 397 return array('headers' => isset($res[0]) ? $res[0] : array(), 'body' => isset($res[1]) ? $res[1] : ''); 397 398 } 398 399 … … 427 428 // In this case, determine the final HTTP header and parse from there. 428 429 for ( $i = count($headers)-1; $i >= 0; $i-- ) { 429 if ( false === strpos($headers[$i], ':') ) {430 if ( !empty($headers[$i]) && false === strpos($headers[$i], ':') ) { 430 431 $headers = array_splice($headers, $i); 431 432 break; … … 440 441 441 442 if ( false === strpos($tempheader, ':') ) { 442 list( , $iResponseCode, $strResponseMsg) = explode(' ', $tempheader, 3); 443 $response['code'] = $iResponseCode; 444 $response['message'] = $strResponseMsg; 443 list( , $response['code'], $response['message']) = explode(' ', $tempheader, 3); 445 444 continue; 446 445 } … … 1229 1228 return array( 'headers' => array(), 'body' => '', 'response' => array('code' => false, 'message' => false), 'cookies' => array() ); 1230 1229 1231 list($theHeaders, $theBody) = explode("\r\n\r\n", $strResponse, 2); 1230 $headers_body = WP_HTTP::processResponse($strResponse); 1231 $theHeaders = $headers_body['headers']; 1232 $theBody = $headers_body['body']; 1233 unset($headers_body); 1234 1232 1235 $theHeaders = WP_Http::processHeaders($theHeaders); 1233 1236
Note: See TracChangeset
for help on using the changeset viewer.