From: moodler Date: Tue, 3 Oct 2006 01:46:16 +0000 (+0000) Subject: Merged endless loop fix from stable X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=8ea7e7b0f7fddebdf7b8a7a63f80ec3d38f60019;p=moodle.git Merged endless loop fix from stable --- diff --git a/lib/statslib.php b/lib/statslib.php index 9963d7725d..1c64226cd5 100644 --- a/lib/statslib.php +++ b/lib/statslib.php @@ -252,7 +252,7 @@ function stats_cron_weekly () { $weeks = 0; mtrace("starting at $timestart"); - while ($sunday >= $nextsunday) { + while ($sunday > $nextsunday && $timestart < $nextsunday) { $timesql = " (timeend > $timestart AND timeend < $nextsunday) "; begin_sql(); @@ -381,7 +381,7 @@ function stats_cron_monthly () { $months = 0; mtrace("starting from $timestart"); - while ($monthend >= $nextmonthend) { + while ($monthend > $nextmonthend && $timestart < $nextmonthend) { $timesql = " (timeend > $timestart AND timeend < $nextmonthend) "; begin_sql();