Permalink
Browse files

Added extra conditions to loops to prevent infinite loops

  • Loading branch information...
1 parent f18c648 commit c8f1d1ca37358d9bc2c0c9273c33b0dcba53a356 moodler committed Oct 3, 2006
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/statslib.php
View
4 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();

0 comments on commit c8f1d1c

Please sign in to comment.