Merge pull request #32731 from frederic34/patch-10

NEW default values for filters that are multiselect array are now supported
This commit is contained in:
Laurent Destailleur 2025-01-23 02:04:56 +01:00 committed by GitHub
commit fdd3ad6fe6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1065,7 +1065,8 @@ function GETPOST($paramname, $check = 'alphanohtml', $method = 0, $filter = null
// Check type of variable and make sanitization according to this
if (preg_match('/^array/', $check)) { // If 'array' or 'array:restricthtml' or 'array:aZ09' or 'array:intcomma'
if (!is_array($out) || empty($out)) {
$out = array();
$out = explode(',', $out);
$tmpcheck = 'alphanohtml';
} else {
$tmparray = explode(':', $check);
if (!empty($tmparray[1])) {
@ -1073,9 +1074,9 @@ function GETPOST($paramname, $check = 'alphanohtml', $method = 0, $filter = null
} else {
$tmpcheck = 'alphanohtml';
}
foreach ($out as $outkey => $outval) {
$out[$outkey] = sanitizeVal($outval, $tmpcheck, $filter, $options);
}
}
foreach ($out as $outkey => $outval) {
$out[$outkey] = sanitizeVal($outval, $tmpcheck, $filter, $options);
}
} else {
// If field name is 'search_xxx' then we force the add of space after each < and > (when following char is numeric) because it means