Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue 966 dot array in old() function #969

Merged
merged 3 commits into from
Mar 21, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions system/HTTP/IncomingRequest.php
Original file line number Diff line number Diff line change
@@ -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;
}
}
}