summaryrefslogtreecommitdiffstats
path: root/system/core/Input.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2014-12-02 17:03:47 +0100
committerAndrey Andreev <narf@devilix.net>2014-12-02 17:03:47 +0100
commitef29f83f786aa968be3d9b7b55ccdc45f33c475d (patch)
tree9cb3bd2b599ff9b73f4fb72cbca777e846c1a8e4 /system/core/Input.php
parent3229e5c5db5e54ed3bd1571c9ea9d01f6fa1de89 (diff)
Some optimizations & polishing following PR #3381
Diffstat (limited to 'system/core/Input.php')
-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];