Fix spawning with SSL. Props dragonhard and rob1n. fixes #3765
git-svn-id: http://svn.automattic.com/wordpress/trunk@4980 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
bb8331b95d
commit
6154ec1c7e
|
@ -83,8 +83,18 @@ function spawn_cron() {
|
|||
|
||||
$cron_url = get_option( 'siteurl' ) . '/wp-cron.php';
|
||||
$parts = parse_url( $cron_url );
|
||||
|
||||
$argyle = @ fsockopen( $parts['host'], $_SERVER['SERVER_PORT'], $errno, $errstr, 0.01 );
|
||||
|
||||
if ($parts['scheme'] == 'https') {
|
||||
// support for SSL was added in 4.3.0
|
||||
if (version_compare(phpversion(), '4.3.0', '>=')) {
|
||||
$argyle = @fsockopen('ssl://' . $parts['host'], $_SERVER['SERVER_PORT'], $errno, $errstr, 0.01);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
$argyle = @ fsockopen( $parts['host'], $_SERVER['SERVER_PORT'], $errno, $errstr, 0.01 );
|
||||
}
|
||||
|
||||
if ( $argyle )
|
||||
fputs( $argyle,
|
||||
"GET {$parts['path']}?check=" . md5(DB_PASS . '187425') . " HTTP/1.0\r\n"
|
||||
|
|
Loading…
Reference in New Issue