mirror of
https://github.com/standardebooks/web.git
synced 2025-07-08 07:40:39 -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(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];
|
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{
|
else{
|
||||||
$var = trim($vars[$variable]);
|
$var = trim($vars[$variable]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue