Make WordPress Core


Ignore:
Timestamp:
05/14/2011 07:45:07 PM (14 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/class-wp-http-ixr-client.php

    r17811 r17928  
    6565        }
    6666
    67         if ( $response['response']['code'] != 200 ) {
    68             $this->error = new IXR_Error(-32301, "transport error - HTTP status code was not 200 ({$response['response']['code']})");
     67        if ( 200 != wp_remote_retrieve_response_code( $response ) ) {
     68            $this->error = new IXR_Error(-32301, 'transport error - HTTP status code was not 200 (' . wp_remote_retrieve_response_code( $response ) . ')');
    6969            return false;
    7070        }
    7171
    7272        if ( $this->debug )
    73             echo '<pre class="ixr_response">' . htmlspecialchars($response['body']) . "\n</pre>\n\n";
     73            echo '<pre class="ixr_response">' . htmlspecialchars( wp_remote_retrieve_body( $response ) ) . "\n</pre>\n\n";
    7474
    7575        // Now parse what we've got back
    76         $this->message = new IXR_Message( $response['body'] );
     76        $this->message = new IXR_Message( wp_remote_retrieve_body( $response ) );
    7777        if ( ! $this->message->parse() ) {
    7878            // XML error
Note: See TracChangeset for help on using the changeset viewer.