- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/class-wp-http-ixr-client.php
r16871 r17928 8 8 */ 9 9 class 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) { 11 12 if ( ! $path ) { 12 13 // Assume we have been given a URL instead … … 14 15 $this->scheme = $bits['scheme']; 15 16 $this->server = $bits['host']; 16 $this->port = isset($bits['port']) ? $bits['port'] : 80;17 $this->port = isset($bits['port']) ? $bits['port'] : $port; 17 18 $this->path = !empty($bits['path']) ? $bits['path'] : '/'; 18 19 … … 36 37 $xml = $request->getXml(); 37 38 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; 39 41 $args = array( 40 42 'headers' => array('Content-Type' => 'text/xml'), … … 63 65 } 64 66 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 ) . ')'); 67 69 return false; 68 70 } 69 71 70 72 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"; 72 74 73 75 // 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 ) ); 75 77 if ( ! $this->message->parse() ) { 76 78 // XML error
Note: See TracChangeset
for help on using the changeset viewer.