MDL-83357 question: Fix filter cleaning in page links

This commit is contained in:
Mark Johnson 2024-10-10 13:30:44 +01:00 committed by Jenkins
parent c5f78e9bd3
commit d0fb2d5cac

View File

@ -222,11 +222,14 @@ function question_build_edit_resources($edittab, $baseurl, $params,
if ($filterkey == 'jointype') {
$cleanparams['filter']['jointype'] = clean_param($filtervalue, PARAM_INT);
} else {
if (!array_key_exists('name', $filtervalue)) {
$filtervalue['name'] = $filterkey;
}
$cleanfilter = [
'name' => clean_param($filtervalue['name'], PARAM_ALPHANUM),
'jointype' => clean_param($filtervalue['jointype'], PARAM_INT),
'values' => $filtervalue['values'],
'filteroptions' => $filtervalue['filteroptions'],
'filteroptions' => $filtervalue['filteroptions'] ?? [],
];
$cleanparams['filter'][$filterkey] = $cleanfilter;
}