Ticket #16402: 16402.2.diff
File 16402.2.diff, 1.3 KB (added by , 14 years ago) |
---|
-
wp-includes/class-wp-http-ixr-client.php
7 7 * 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 function WP_HTTP_IXR_Client($server, $path = false, $port = false, $timeout = 15) { 11 11 if ( ! $path ) { 12 12 // Assume we have been given a URL instead 13 13 $bits = parse_url($server); 14 14 $this->scheme = $bits['scheme']; 15 15 $this->server = $bits['host']; 16 $this->port = isset($bits['port']) ? $bits['port'] : 80;16 $this->port = isset($bits['port']) ? $bits['port'] : $port; 17 17 $this->path = !empty($bits['path']) ? $bits['path'] : '/'; 18 18 19 19 // Make absolutely sure we have a path … … 35 35 $request = new IXR_Request($method, $args); 36 36 $xml = $request->getXml(); 37 37 38 $url = $this->scheme . '://' . $this->server . ':' . $this->port . $this->path; 38 $port = $this->port ? ":$this->port" : ''; 39 $url = $this->scheme . '://' . $this->server . $port . $this->path; 39 40 $args = array( 40 41 'headers' => array('Content-Type' => 'text/xml'), 41 42 'user-agent' => $this->useragent,