mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +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;
|
||||
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue