Skip to content

Commit fdd3ad6

Browse files
authored
Merge pull request #32731 from frederic34/patch-10
NEW default values for filters that are multiselect array are now supported
2 parents 69f5e37 + 24d8dec commit fdd3ad6

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

htdocs/core/lib/functions.lib.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,17 +1065,18 @@ function GETPOST($paramname, $check = 'alphanohtml', $method = 0, $filter = null
10651065
// Check type of variable and make sanitization according to this
10661066
if (preg_match('/^array/', $check)) { // If 'array' or 'array:restricthtml' or 'array:aZ09' or 'array:intcomma'
10671067
if (!is_array($out) || empty($out)) {
1068-
$out = array();
1068+
$out = explode(',', $out);
1069+
$tmpcheck = 'alphanohtml';
10691070
} else {
10701071
$tmparray = explode(':', $check);
10711072
if (!empty($tmparray[1])) {
10721073
$tmpcheck = $tmparray[1];
10731074
} else {
10741075
$tmpcheck = 'alphanohtml';
10751076
}
1076-
foreach ($out as $outkey => $outval) {
1077-
$out[$outkey] = sanitizeVal($outval, $tmpcheck, $filter, $options);
1078-
}
1077+
}
1078+
foreach ($out as $outkey => $outval) {
1079+
$out[$outkey] = sanitizeVal($outval, $tmpcheck, $filter, $options);
10791080
}
10801081
} else {
10811082
// If field name is 'search_xxx' then we force the add of space after each < and > (when following char is numeric) because it means

0 commit comments

Comments
 (0)