mirror of
https://github.com/moodle/moodle.git
synced 2025-04-23 09:23:09 +02:00
MDL-78790 gradereport_grader: normalise report sort parameter safely.
This commit is contained in:
parent
ff75f4c675
commit
b417f1edf2
@ -33,7 +33,7 @@ $page = optional_param('page', 0, PARAM_INT); // active page
|
||||
$edit = optional_param('edit', -1, PARAM_BOOL); // sticky editting mode
|
||||
|
||||
$sortitemid = optional_param('sortitemid', 0, PARAM_ALPHANUMEXT);
|
||||
$sort = optional_param('sort', '', PARAM_TEXT);
|
||||
$sort = optional_param('sort', '', PARAM_ALPHA);
|
||||
$action = optional_param('action', 0, PARAM_ALPHAEXT);
|
||||
$move = optional_param('move', 0, PARAM_INT);
|
||||
$type = optional_param('type', 0, PARAM_ALPHA);
|
||||
@ -130,8 +130,8 @@ grade_regrade_final_grades_if_required($course);
|
||||
|
||||
//Initialise the grader report object that produces the table
|
||||
//the class grade_report_grader_ajax was removed as part of MDL-21562
|
||||
if ($sort) {
|
||||
$sort = strtoupper($sort);
|
||||
if ($sort && strcasecmp($sort, 'desc') !== 0) {
|
||||
$sort = 'asc';
|
||||
}
|
||||
$report = new grade_report_grader($courseid, $gpr, $context, $page, $sortitemid, $sort);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user