diff --git a/wp-cron.php b/wp-cron.php index 2145028bf8..69a1e9480f 100644 --- a/wp-cron.php +++ b/wp-cron.php @@ -3,6 +3,9 @@ ignore_user_abort(true); define('DOING_CRON', TRUE); require_once('wp-config.php'); +if ( $_GET['check'] != md5(DB_PASS . '187425') ) + exit; + $crons = get_option('cron'); if (!is_array($crons) || array_shift(array_keys($crons)) > time()) return; @@ -12,7 +15,6 @@ foreach ($crons as $timestamp => $cronhooks) { do_action($hook, $args['args']); $schedule = $args['schedule']; if($schedule != false) { - fwrite($fp, var_export($schedules[$schedule])); $args = array_merge( array($timestamp, $schedule, $hook), $args['args']); call_user_func_array('wp_reschedule_event', $args); } diff --git a/wp-includes/cron.php b/wp-includes/cron.php index ca44bed2e6..e964abae03 100644 --- a/wp-includes/cron.php +++ b/wp-includes/cron.php @@ -49,7 +49,7 @@ function wp_unschedule_event($timestamp, $hook) { } function wp_clear_scheduled_hook($hook) { - while($timestamp = next_scheduled($hook)) + while($timestamp = wp_next_scheduled($hook)) wp_unschedule_event($timestamp, $hook); } @@ -72,8 +72,10 @@ function spawn_cron() { $argyle = @ fsockopen($parts['host'], $_SERVER['SERVER_PORT'], $errno, $errstr, 0.01); if ( $argyle ) - fputs($argyle, "GET {$parts['path']}?time=" . time() . '&check=' - . md5(DB_PASS . '187425') . " HTTP/1.0\r\nHost: {$_SERVER['HTTP_HOST']}\r\n\r\n"); + fputs($argyle, + "GET {$parts['path']}?check=" . md5(DB_PASS . '187425') . " HTTP/1.0\r\n" + . "Host: {$_SERVER['HTTP_HOST']}\r\n\r\n" + ); } function wp_cron() { @@ -100,4 +102,4 @@ function wp_get_schedules() { ); return array_merge(apply_filters('cron_schedules', array()), $schedules); } -?> \ No newline at end of file +?>