Permalink
Browse files

MDL-31782 core_grade: fixed a potential infinite loop

  • Loading branch information...
1 parent c5575c6 commit 6bff753746b0cfa488d9e211fa632c61d361a53d @andyjdavis andyjdavis committed Sep 27, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/grade/grade_category.php
View
5 lib/grade/grade_category.php
@@ -917,7 +917,10 @@ public function apply_limit_rules(&$grade_values, $items) {
$i = 1;
while ($originalindex+$i < count($grade_keys)) {
+
$possibleitemid = $grade_keys[$originalindex+$i];
+ $i++;
+
if ($grade_values[$founditemid] != $grade_values[$possibleitemid]) {
// The next grade item has a different grade. Stop looking.
break;
@@ -934,8 +937,6 @@ public function apply_limit_rules(&$grade_values, $items) {
$founditemid = $possibleitemid;
// Continue searching to see if there is an even higher grademax...
}
-
- $i++;
}
// Now drop whatever grade item we have found

0 comments on commit 6bff753

Please sign in to comment.