Skip to content

Commit

Permalink
Fix issue 966 dot array in old() function
Browse files Browse the repository at this point in the history
Signed-off-by: Gabriel P <[email protected]>
  • Loading branch information
gabriel-pnhr committed Mar 20, 2018
1 parent 4457529 commit cd31a89
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions system/HTTP/IncomingRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -494,15 +494,23 @@ public function getOldInput(string $key)
helper('array');

// Check for an array value in POST.
if (isset($_SESSION['_ci_old_input']['post']) && dot_array_search($key, $_SESSION['_ci_old_input']['post']))
if (isset($_SESSION['_ci_old_input']['post']))
{
return dot_array_search($key, $_SESSION['_ci_old_input']['post']);
$value = dot_array_search($key, $_SESSION['_ci_old_input']['post']);
if ( ! is_null($value))
{
return $value;
}
}

// Check for an array value in GET.
if (isset($_SESSION['_ci_old_input']['get']) && dot_array_search($key, $_SESSION['_ci_old_input']['get']))
if (isset($_SESSION['_ci_old_input']['get']))
{
return dot_array_search($key, $_SESSION['_ci_old_input']['get']);
$value = dot_array_search($key, $_SESSION['_ci_old_input']['get']);
if ( ! is_null($value))
{
return $value;
}
}
}

Expand Down

0 comments on commit cd31a89

Please sign in to comment.