WordPress.org

Make WordPress Core

Ticket #16402: 16402.2.diff

File 16402.2.diff, 1.3 KB (added by mdawaffe, 7 years ago)
  • wp-includes/class-wp-http-ixr-client.php

     
    77 *
    88 */
    99class 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) {
    1111                if ( ! $path ) {
    1212                        // Assume we have been given a URL instead
    1313                        $bits = parse_url($server);
    1414                        $this->scheme = $bits['scheme'];
    1515                        $this->server = $bits['host'];
    16                         $this->port = isset($bits['port']) ? $bits['port'] : 80;
     16                        $this->port = isset($bits['port']) ? $bits['port'] : $port;
    1717                        $this->path = !empty($bits['path']) ? $bits['path'] : '/';
    1818
    1919                        // Make absolutely sure we have a path
     
    3535                $request = new IXR_Request($method, $args);
    3636                $xml = $request->getXml();
    3737
    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;
    3940                $args = array(
    4041                        'headers'    => array('Content-Type' => 'text/xml'),
    4142                        'user-agent' => $this->useragent,