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

git-svn-id: http://svn.automattic.com/wordpress/trunk@10969 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2009-04-17 00:23:48 +00:00
parent 097b84333d
commit 6c8badc7c7
1 changed files with 6 additions and 2 deletions

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 );
}