Make WordPress Core


Ignore:
Timestamp:
05/14/2011 07:45:07 PM (13 years ago)
Author:
nacin
Message:

Use wp_remote_retrieve_* helper functions instead of the raw HTTP response array. props aaroncampbell, fixes #17416.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/rss.php

    r17071 r17928  
    556556    // Also note, WP_HTTP lowercases all keys, Snoopy did not.
    557557    $return_headers = array();
    558     foreach ( $resp['headers'] as $key => $value ) {
     558    foreach ( wp_remote_retrieve_headers( $resp ) as $key => $value ) {
    559559        if ( !is_array($value) ) {
    560560            $return_headers[] = "$key: $value";
     
    566566
    567567    $response = new stdClass;
    568     $response->status = $resp['response']['code'];
    569     $response->response_code = $resp['response']['code'];
     568    $response->status = wp_remote_retrieve_response_code( $resp );
     569    $response->response_code = wp_remote_retrieve_response_code( $resp );
    570570    $response->headers = $return_headers;
    571     $response->results = $resp['body'];
     571    $response->results = wp_remote_retrieve_body( $resp );
    572572
    573573    return $response;
Note: See TracChangeset for help on using the changeset viewer.