mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 17:36:38 +02:00
MDL-31782 core_grade: fixed a potential infinite loop
This commit is contained in:
parent
9273bd1abb
commit
410d0dc243
1 changed files with 3 additions and 2 deletions
|
@ -911,7 +911,10 @@ class grade_category extends grade_object {
|
||||||
|
|
||||||
$i = 1;
|
$i = 1;
|
||||||
while ($originalindex+$i < count($grade_keys)) {
|
while ($originalindex+$i < count($grade_keys)) {
|
||||||
|
|
||||||
$possibleitemid = $grade_keys[$originalindex+$i];
|
$possibleitemid = $grade_keys[$originalindex+$i];
|
||||||
|
$i++;
|
||||||
|
|
||||||
if ($grade_values[$founditemid] != $grade_values[$possibleitemid]) {
|
if ($grade_values[$founditemid] != $grade_values[$possibleitemid]) {
|
||||||
// The next grade item has a different grade. Stop looking.
|
// The next grade item has a different grade. Stop looking.
|
||||||
break;
|
break;
|
||||||
|
@ -928,8 +931,6 @@ class grade_category extends grade_object {
|
||||||
$founditemid = $possibleitemid;
|
$founditemid = $possibleitemid;
|
||||||
// Continue searching to see if there is an even higher grademax...
|
// Continue searching to see if there is an even higher grademax...
|
||||||
}
|
}
|
||||||
|
|
||||||
$i++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now drop whatever grade item we have found
|
// Now drop whatever grade item we have found
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue