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
This commit is contained in:
parent
1379f7a976
commit
4141e704e5
|
@ -8,13 +8,13 @@
|
||||||
*/
|
*/
|
||||||
class WP_HTTP_IXR_Client extends IXR_Client {
|
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 ) {
|
if ( ! $path ) {
|
||||||
// Assume we have been given a URL instead
|
// Assume we have been given a URL instead
|
||||||
$bits = parse_url($server);
|
$bits = parse_url($server);
|
||||||
$this->scheme = $bits['scheme'];
|
$this->scheme = $bits['scheme'];
|
||||||
$this->server = $bits['host'];
|
$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'] : '/';
|
$this->path = !empty($bits['path']) ? $bits['path'] : '/';
|
||||||
|
|
||||||
// Make absolutely sure we have a 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);
|
$request = new IXR_Request($method, $args);
|
||||||
$xml = $request->getXml();
|
$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(
|
$args = array(
|
||||||
'headers' => array('Content-Type' => 'text/xml'),
|
'headers' => array('Content-Type' => 'text/xml'),
|
||||||
'user-agent' => $this->useragent,
|
'user-agent' => $this->useragent,
|
||||||
|
|
Loading…
Reference in New Issue