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:
ryan 2007-03-07 01:47:57 +00:00
parent bb8331b95d
commit 6154ec1c7e
1 changed files with 12 additions and 2 deletions

View File

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