Fix handling of old timestamps in wp_reschedule_event(). Props natethelen. fixes #9318

git-svn-id: https://develop.svn.wordpress.org/trunk@10969 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2009-04-17 00:23:48 +00:00
parent 50ca48415a
commit 5159541678

View File

@ -88,8 +88,12 @@ function wp_reschedule_event( $timestamp, $recurrence, $hook, $args = array()) {
if ( 0 == $interval )
return false;
while ( $timestamp < time() + 1 )
$timestamp += $interval;
$now = time();
if ( $timestamp >= $now )
$timestamp = $now + $interval;
else
$timestamp = $now + ($interval - (($now - $timestamp) % $interval));
wp_schedule_event( $timestamp, $recurrence, $hook, $args );
}