Improve array handling when getting query string vars

This commit is contained in:
Alex Cabal 2021-06-06 21:54:03 -05:00
parent f674a6c0c2
commit da88967069

View file

@ -49,9 +49,14 @@ class HttpInput{
}
if(isset($vars[$variable])){
if(is_array($vars[$variable])){
if($type == HTTP_VAR_ARRAY && is_array($vars[$variable])){
// We asked for an array, and we got one
return $vars[$variable];
}
elseif($type !== HTTP_VAR_ARRAY && is_array($vars[$variable])){
// We asked for not an array, but we got an array
return $default;
}
else{
$var = trim($vars[$variable]);
}