Make WordPress Core


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/class-wp-http-ixr-client.php

    r16871 r17928  
    88 */
    99class WP_HTTP_IXR_Client extends IXR_Client {
    10     function WP_HTTP_IXR_Client($server, $path = false, $port = 80, $timeout = 15) {
     10
     11    function __construct($server, $path = false, $port = false, $timeout = 15) {
    1112        if ( ! $path ) {
    1213            // Assume we have been given a URL instead
     
    1415            $this->scheme = $bits['scheme'];
    1516            $this->server = $bits['host'];
    16             $this->port = isset($bits['port']) ? $bits['port'] : 80;
     17            $this->port = isset($bits['port']) ? $bits['port'] : $port;
    1718            $this->path = !empty($bits['path']) ? $bits['path'] : '/';
    1819
     
    3637        $xml = $request->getXml();
    3738
    38         $url = $this->scheme . '://' . $this->server . ':' . $this->port . $this->path;
     39        $port = $this->port ? ":$this->port" : '';
     40        $url = $this->scheme . '://' . $this->server . $port . $this->path;
    3941        $args = array(
    4042            'headers'    => array('Content-Type' => 'text/xml'),
     
    6365        }
    6466
    65         if ( $response['response']['code'] != 200 ) {
    66             $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 ) . ')');
    6769            return false;
    6870        }
    6971
    7072        if ( $this->debug )
    71             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";
    7274
    7375        // Now parse what we've got back
    74         $this->message = new IXR_Message( $response['body'] );
     76        $this->message = new IXR_Message( wp_remote_retrieve_body( $response ) );
    7577        if ( ! $this->message->parse() ) {
    7678            // XML error
Note: See TracChangeset for help on using the changeset viewer.