From 9e78be0d736ed0caab396f58109ce1db7169d727 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Wed, 25 May 2016 10:54:36 +0300 Subject: Fix #4639 Really fix #4633 --- system/libraries/Form_validation.php | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'system/libraries') diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php index f5b07a205..04445f5b7 100644 --- a/system/libraries/Form_validation.php +++ b/system/libraries/Form_validation.php @@ -696,6 +696,17 @@ class CI_Form_validation { $param = $match[2]; } + // Ignore empty, non-required inputs with a few exceptions ... + if ( + ($postdata === NULL OR $postdata === '') + && $callback === FALSE + && $callable === FALSE + && ! in_array($rule, array('required', 'isset', 'matches'), TRUE) + ) + { + continue; + } + // Call the function that corresponds to the rule if ($callback OR $callable !== FALSE) { -- cgit v1.2.3-24-g4f1b