From a088cc47a7104e11d78eac44851779d20bae9cbc Mon Sep 17 00:00:00 2001 From: Zach Ploskey Date: Wed, 4 Oct 2017 05:24:53 -0700 Subject: Fix issue 5202 Fix attempting to access data_ref before it is defined when validating an array input with multiple explicitly specified keys. Adds a test for the issue. Signed-off-by: Zach Ploskey --- system/libraries/Form_validation.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'system/libraries/Form_validation.php') diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php index c1cfcdb8f..0dfb274b2 100644 --- a/system/libraries/Form_validation.php +++ b/system/libraries/Form_validation.php @@ -591,6 +591,8 @@ class CI_Form_validation { } else { + $data_ref =& $data; + // before we assign values, make a reference to the right POST key if (count($row['keys']) === 1) { -- cgit v1.2.3-24-g4f1b