From c8f1d1ca37358d9bc2c0c9273c33b0dcba53a356 Mon Sep 17 00:00:00 2001 From: moodler Date: Tue, 3 Oct 2006 01:44:15 +0000 Subject: [PATCH] Added extra conditions to loops to prevent infinite loops ref the same fix made for daily loops already: http://moodle.cvs.sourceforge.net/moodle/moodle/lib/statslib.php?r1=1.21.2.4&r2=1.21.2.5 --- lib/statslib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/statslib.php b/lib/statslib.php index 48e939d40f1..9e91de38a6d 100644 --- a/lib/statslib.php +++ b/lib/statslib.php @@ -238,7 +238,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(); @@ -347,7 +347,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(); -- 2.11.4.GIT