mirror of
https://github.com/moodle/moodle.git
synced 2025-04-05 08:23:01 +02:00
MDL-83357 question: Additional cleaning of filter params
This commit is contained in:
parent
0ff35dc282
commit
c5f78e9bd3
@ -217,7 +217,20 @@ function question_build_edit_resources($edittab, $baseurl, $params,
|
||||
if (!is_array($params['filter'])) {
|
||||
$params['filter'] = json_decode($params['filter'], true);
|
||||
}
|
||||
$cleanparams['filter'] = $params['filter'];
|
||||
$cleanparams['filter'] = [];
|
||||
foreach ($params['filter'] as $filterkey => $filtervalue) {
|
||||
if ($filterkey == 'jointype') {
|
||||
$cleanparams['filter']['jointype'] = clean_param($filtervalue, PARAM_INT);
|
||||
} else {
|
||||
$cleanfilter = [
|
||||
'name' => clean_param($filtervalue['name'], PARAM_ALPHANUM),
|
||||
'jointype' => clean_param($filtervalue['jointype'], PARAM_INT),
|
||||
'values' => $filtervalue['values'],
|
||||
'filteroptions' => $filtervalue['filteroptions'],
|
||||
];
|
||||
$cleanparams['filter'][$filterkey] = $cleanfilter;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($params['sortdata'])) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user