Fix GETPOST on array

This commit is contained in:
Laurent Destailleur
2020-09-29 21:28:07 +02:00
parent 879d041398
commit 1e176fad8f
2 changed files with 18 additions and 10 deletions

View File

@@ -545,12 +545,18 @@ function GETPOST($paramname, $check = 'alphanohtml', $method = 0, $filter = null
}
// Check rule
if ($check == 'array') {
if (preg_match('/^array/', $check)) { // If 'array' or 'array:restricthtml' or 'array:aZ09'
if (!is_array($out) || empty($out)) {
$out = array();
} else {
$tmparray = explode(':', $check);
if (!empty($tmparray[1])) {
$tmpcheck = $tmparray[1];
} else {
$tmpcheck = 'alphanohtml';
}
foreach ($out as $outkey => $outval) {
$out[$outkey] = checkVal($outval, 'alphanohtml', $filter, $options);
$out[$outkey] = checkVal($outval, $tmpcheck, $filter, $options);
}
}
}