Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-31782 core_grade: fixed a potential infinite loop

  • Loading branch information...
commit 410d0dc2435c4bc4e6ede3b3de4b5924c7dd1a44 1 parent 9273bd1
@andyjdavis andyjdavis authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/grade/grade_category.php
View
5 lib/grade/grade_category.php
@@ -911,7 +911,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;
@@ -928,8 +931,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
Please sign in to comment.
Something went wrong with that request. Please try again.