From cd31a89a10c29d7d8bf795b067a974f954ae6499 Mon Sep 17 00:00:00 2001 From: Gabriel P <16049869+gabpnr@users.noreply.github.com> Date: Tue, 20 Mar 2018 09:11:18 +0100 Subject: [PATCH] Fix issue 966 dot array in old() function Signed-off-by: Gabriel P <16049869+gabpnr@users.noreply.github.com> --- system/HTTP/IncomingRequest.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/system/HTTP/IncomingRequest.php b/system/HTTP/IncomingRequest.php index 29beb766a21d..1d76ad9aacbf 100755 --- a/system/HTTP/IncomingRequest.php +++ b/system/HTTP/IncomingRequest.php @@ -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; + } } }