Properly handle https in ixr client. Props mdawaffe. fixes #16402

git-svn-id: https://develop.svn.wordpress.org/trunk@17811 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2011-05-05 18:57:29 +00:00
parent d36556bca2
commit 771b3557c5

View File

@ -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,