MDL-31782 core_grade: fixed a potential infinite loop
This commit is contained in:
@@ -911,7 +911,10 @@ class grade_category extends grade_object {
|
||||
|
||||
$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 @@ class grade_category extends grade_object {
|
||||
$founditemid = $possibleitemid;
|
||||
// Continue searching to see if there is an even higher grademax...
|
||||
}
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
// Now drop whatever grade item we have found
|
||||
|
||||
Reference in New Issue
Block a user