WordPress.org

Make WordPress Core

Ticket #4782: 4782.diff

File 4782.diff, 903 bytes (added by Nazgul, 7 years ago)
  • wp-includes/cron.php

     
    8787        if ($parts['scheme'] == 'https') { 
    8888                // support for SSL was added in 4.3.0 
    8989                if (version_compare(phpversion(), '4.3.0', '>=') && function_exists('openssl_open')) { 
    90                         $argyle = @fsockopen('ssl://' . $parts['host'], $_SERVER['SERVER_PORT'], $errno, $errstr, 0.01); 
     90                        $port = isset($parts['port']) ? $parts['port'] : 443; 
     91                        $argyle = @fsockopen('ssl://' . $parts['host'], $port, $errno, $errstr, 0.01); 
    9192                } else { 
    9293                        return false; 
    9394                } 
    9495        } else { 
    95                 $argyle = @ fsockopen( $parts['host'], $_SERVER['SERVER_PORT'], $errno, $errstr, 0.01 ); 
     96                $port = isset($parts['port']) ? $parts['port'] : 80; 
     97                $argyle = @ fsockopen( $parts['host'], $port, $errno, $errstr, 0.01 ); 
    9698        } 
    9799 
    98100        if ( $argyle )