summaryrefslogtreecommitdiffstats
path: root/system/core
diff options
context:
space:
mode:
Diffstat (limited to 'system/core')
-rw-r--r--system/core/Input.php22
1 files changed, 17 insertions, 5 deletions
diff --git a/system/core/Input.php b/system/core/Input.php
index 81555df9a..11b2e94e0 100644
--- a/system/core/Input.php
+++ b/system/core/Input.php
@@ -150,7 +150,7 @@ class CI_Input {
* Internal method used to retrieve values from global arrays.
*
* @param array &$array $_GET, $_POST, $_COOKIE, $_SERVER, etc.
- * @param string $index Index for item to be fetched from $array
+ * @param mixed $index Index for item to be fetched from $array
* @param bool $xss_clean Whether to apply XSS filtering
* @return mixed
*/
@@ -168,6 +168,18 @@ class CI_Input {
return $output;
}
+ // allow fetching multiple keys at once
+ if (is_array($index))
+ {
+ $output = array();
+ foreach ($index as $var)
+ {
+ $output[$var] = $this->_fetch_from_array($array, $var, $xss_clean);
+ }
+
+ return $output;
+ }
+
is_bool($xss_clean) OR $xss_clean = $this->_enable_xss;
if (isset($array[$index]))
@@ -210,7 +222,7 @@ class CI_Input {
/**
* Fetch an item from the GET array
*
- * @param string $index Index for item to be fetched from $_GET
+ * @param mixed $index Index for item to be fetched from $_GET
* @param bool $xss_clean Whether to apply XSS filtering
* @return mixed
*/
@@ -224,7 +236,7 @@ class CI_Input {
/**
* Fetch an item from the POST array
*
- * @param string $index Index for item to be fetched from $_POST
+ * @param mixed $index Index for item to be fetched from $_POST
* @param bool $xss_clean Whether to apply XSS filtering
* @return mixed
*/
@@ -270,7 +282,7 @@ class CI_Input {
/**
* Fetch an item from the COOKIE array
*
- * @param string $index Index for item to be fetched from $_COOKIE
+ * @param mixed $index Index for item to be fetched from $_COOKIE
* @param bool $xss_clean Whether to apply XSS filtering
* @return mixed
*/
@@ -284,7 +296,7 @@ class CI_Input {
/**
* Fetch an item from the SERVER array
*
- * @param string $index Index for item to be fetched from $_SERVER
+ * @param mixed $index Index for item to be fetched from $_SERVER
* @param bool $xss_clean Whether to apply XSS filtering
* @return mixed
*/