diff options
author | Andrey Andreev <narf@bofh.bg> | 2012-11-20 15:34:15 +0100 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2012-11-20 15:34:15 +0100 |
commit | 77bd21b15305412b63c8f448787d5b275efd07e2 (patch) | |
tree | 8be434b97647acf81a02251f53c240c5ba697e11 /system/core/Input.php | |
parent | a2b06771202365af678df478eab4e68aa7006d68 (diff) |
Fix CI_Input::get() and CI_Input::post() not returning array when a key is not specified
Diffstat (limited to 'system/core/Input.php')
-rw-r--r-- | system/core/Input.php | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/system/core/Input.php b/system/core/Input.php index 4d73fa424..a3ad14e24 100644 --- a/system/core/Input.php +++ b/system/core/Input.php @@ -178,8 +178,13 @@ class CI_Input { public function get($index = NULL, $xss_clean = FALSE) { // Check if a field has been provided - if ($index === NULL && ! empty($_GET)) + if ($index === NULL) { + if (empty($_GET)) + { + return array(); + } + $get = array(); // loop through the full _GET array @@ -205,8 +210,13 @@ class CI_Input { public function post($index = NULL, $xss_clean = FALSE) { // Check if a field has been provided - if ($index === NULL && ! empty($_POST)) + if ($index === NULL) { + if (empty($_POST)) + { + return array(); + } + $post = array(); // Loop through the full _POST array and return it |