Skip to content

Commit

Permalink
Fix CI_Input::get() and CI_Input::post() not returning array when a k…
Browse files Browse the repository at this point in the history
…ey is not specified
  • Loading branch information
narfbg committed Nov 20, 2012
1 parent a2b0677 commit 77bd21b
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions system/core/Input.php
Expand Up @@ -178,8 +178,13 @@ protected function _fetch_from_array(&$array, $index = '', $xss_clean = FALSE)
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
Expand All @@ -205,8 +210,13 @@ public function get($index = NULL, $xss_clean = FALSE)
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
Expand Down

0 comments on commit 77bd21b

Please sign in to comment.