summaryrefslogtreecommitdiffstats
path: root/wp-includes/cron.php
diff options
context:
space:
mode:
Diffstat (limited to 'wp-includes/cron.php')
-rw-r--r--wp-includes/cron.php14
1 files changed, 12 insertions, 2 deletions
diff --git a/wp-includes/cron.php b/wp-includes/cron.php
index 40004ca..e9a6462 100644
--- a/wp-includes/cron.php
+++ b/wp-includes/cron.php
@@ -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', '>=') && function_exists('openssl_open')) {
+ $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"