mirror of
https://github.com/standardebooks/web.git
synced 2025-07-07 23:30:35 -04:00
Improve array handling when getting query string vars
This commit is contained in:
parent
f674a6c0c2
commit
da88967069
1 changed files with 6 additions and 1 deletions
|
@ -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]);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue