Changeset 8523
- Timestamp:
- 08/01/2008 10:31:57 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/http.php
r8522 r8523 314 314 * Transform header string into an array. 315 315 * 316 * If an array is given, then it will be immediately passed through with no 317 * changes. This is to prevent overhead in processing headers that don't 318 * need to be processed. That and it is unknown what kind of effect 319 * processing the array will have since there is no checking done on whether 320 * ':' does not exist within the array string. 321 * 322 * Checking could be added, but it is easier and faster to just passed the 323 * array through and assume that it has already been processed. 316 * If an array is given then it is assumed to be raw header data with 317 * numeric keys with the headers as the values. No headers must be passed 318 * that were already processed. 324 319 * 325 320 * @access public … … 331 326 */ 332 327 function processHeaders($headers) { 333 if ( is_array($headers) ) 334 return $headers; 335 336 $headers = explode("\n", str_replace(array("\r\n", "\r"), "\n", $headers) ); 328 if ( is_string($headers) ) 329 $headers = explode("\n", str_replace(array("\r\n", "\r"), "\n", $headers) ); 337 330 338 331 $response = array('code' => 0, 'message' => ''); … … 343 336 continue; 344 337 338 345 339 if ( false === strpos($tempheader, ':') ) { 346 340 list( , $iResponseCode, $strResponseMsg) = explode(' ', $tempheader, 3); … … 561 555 $theHeaders = $http_response_header; 562 556 } 557 558 fclose($handle); 559 563 560 $processedHeaders = WP_Http::processHeaders($theHeaders); 564 561 565 fclose($handle);566 562 return array('headers' => $processedHeaders['headers'], 'body' => $strResponse, 'response' => $processedHeaders['response']); 567 563 } … … 763 759 764 760 $theResponse = array(); 765 $theResponse[' response']['code'] = $info['response_code'];766 $theResponse[' response']['message'] = get_status_header_desc($info['response_code']);761 $theResponse['code'] = $info['response_code']; 762 $theResponse['message'] = get_status_header_desc($info['response_code']); 767 763 768 764 return array('headers' => $theHeaders['headers'], 'body' => $theBody, 'response' => $theResponse);
Note: See TracChangeset
for help on using the changeset viewer.