]> git.mjollnir.org Git - moodle.git/commitdiff
Merged endless loop fix from stable
authormoodler <moodler>
Tue, 3 Oct 2006 01:46:16 +0000 (01:46 +0000)
committermoodler <moodler>
Tue, 3 Oct 2006 01:46:16 +0000 (01:46 +0000)
lib/statslib.php

index 9963d7725d1502fde37bb736aacc925d6b8b82a3..1c64226cd54864859d803fb08a6e0e04437757b3 100644 (file)
@@ -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();