summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
Diffstat (limited to 'system')
-rw-r--r--system/core/Input.php19
1 files changed, 5 insertions, 14 deletions
diff --git a/system/core/Input.php b/system/core/Input.php
index 11b2e94e0..d1353e9dc 100644
--- a/system/core/Input.php
+++ b/system/core/Input.php
@@ -156,32 +156,23 @@ class CI_Input {
*/
protected function _fetch_from_array(&$array, $index = NULL, $xss_clean = NULL)
{
- // If $index is NULL, it means that the whole $array is requested
- if ($index === NULL)
- {
- $output = array();
- foreach (array_keys($array) as $key)
- {
- $output[$key] = $this->_fetch_from_array($array, $key, $xss_clean);
- }
+ is_bool($xss_clean) OR $xss_clean = $this->_enable_xss;
- return $output;
- }
+ // If $index is NULL, it means that the whole $array is requested
+ isset($index) OR $index = array_keys($array);
// allow fetching multiple keys at once
if (is_array($index))
{
$output = array();
- foreach ($index as $var)
+ foreach (array_keys($array) as $key)
{
- $output[$var] = $this->_fetch_from_array($array, $var, $xss_clean);
+ $output[$key] = $this->_fetch_from_array($array, $key, $xss_clean);
}
return $output;
}
- is_bool($xss_clean) OR $xss_clean = $this->_enable_xss;
-
if (isset($array[$index]))
{
$value = $array[$index];