From 4141e704e56a9cb76dc74140aa7c18f970f45e69 Mon Sep 17 00:00:00 2001 From: ryan Date: Thu, 5 May 2011 18:57:29 +0000 Subject: [PATCH] Properly handle https in ixr client. Props mdawaffe. fixes #16402 git-svn-id: http://svn.automattic.com/wordpress/trunk@17811 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-http-ixr-client.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/wp-includes/class-wp-http-ixr-client.php b/wp-includes/class-wp-http-ixr-client.php index b4c2184e14..994ae5726a 100644 --- a/wp-includes/class-wp-http-ixr-client.php +++ b/wp-includes/class-wp-http-ixr-client.php @@ -8,13 +8,13 @@ */ class WP_HTTP_IXR_Client extends IXR_Client { - function __construct($server, $path = false, $port = 80, $timeout = 15) { + function __construct($server, $path = false, $port = false, $timeout = 15) { if ( ! $path ) { // Assume we have been given a URL instead $bits = parse_url($server); $this->scheme = $bits['scheme']; $this->server = $bits['host']; - $this->port = isset($bits['port']) ? $bits['port'] : 80; + $this->port = isset($bits['port']) ? $bits['port'] : $port; $this->path = !empty($bits['path']) ? $bits['path'] : '/'; // Make absolutely sure we have a path @@ -36,7 +36,8 @@ class WP_HTTP_IXR_Client extends IXR_Client { $request = new IXR_Request($method, $args); $xml = $request->getXml(); - $url = $this->scheme . '://' . $this->server . ':' . $this->port . $this->path; + $port = $this->port ? ":$this->port" : ''; + $url = $this->scheme . '://' . $this->server . $port . $this->path; $args = array( 'headers' => array('Content-Type' => 'text/xml'), 'user-agent' => $this->useragent,