Changeset 13848 for trunk/wp-includes/rss.php
- Timestamp:
- 03/28/2010 12:33:25 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/rss.php
r13725 r13848 541 541 * @return Snoopy style response 542 542 */ 543 function _fetch_remote_file 543 function _fetch_remote_file($url, $headers = "" ) { 544 544 $resp = wp_remote_request($url, array('headers' => $headers, 'timeout' => MAGPIE_FETCH_TIME_OUT)); 545 545 if ( is_wp_error($resp) ) { … … 552 552 return $resp; 553 553 } 554 555 // Snoopy returns headers unprocessed. 556 // Also note, WP_HTTP lowercases all keys, Snoopy did not. 557 $return_headers = array(); 558 foreach ( $resp['headers'] as $key => $value ) { 559 if ( !is_array($value) ) { 560 $return_headers[] = "$key: $value"; 561 } else { 562 foreach ( $value as $v ) 563 $return_headers[] = "$key: $v"; 564 } 565 } 566 554 567 $response = new stdClass; 555 568 $response->status = $resp['response']['code']; 556 569 $response->response_code = $resp['response']['code']; 557 $response->headers = $re sp['headers'];570 $response->headers = $return_headers; 558 571 $response->results = $resp['body']; 559 572 … … 588 601 } 589 602 590 if ( $field == ' ETag' ) {603 if ( $field == 'etag' ) { 591 604 $rss->etag = $val; 592 605 } 593 606 594 if ( $field == ' Last-Modified' ) {607 if ( $field == 'last-modified' ) { 595 608 $rss->last_modified = $val; 596 609 }
Note: See TracChangeset
for help on using the changeset viewer.