summaryrefslogtreecommitdiffstats
path: root/system/libraries/Form_validation.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2016-03-12 10:40:34 +0100
committerAndrey Andreev <narf@devilix.net>2016-03-12 10:40:34 +0100
commit7243d0b9019eec108255fae5b7eaf08a14a8092e (patch)
treea1b7e01a0e53badef4acff6e197e4503deded55e /system/libraries/Form_validation.php
parent1719223f936c1f202b176ebeba7718f6b24e4886 (diff)
Fix #4516
Diffstat (limited to 'system/libraries/Form_validation.php')
-rw-r--r--system/libraries/Form_validation.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php
index 296ddb92a..09d6c9a97 100644
--- a/system/libraries/Form_validation.php
+++ b/system/libraries/Form_validation.php
@@ -583,7 +583,10 @@ class CI_Form_validation {
protected function _execute($row, $rules, $postdata = NULL, $cycles = 0)
{
// If the $_POST data is an array we will run a recursive call
- if (is_array($postdata))
+ //
+ // Note: We MUST check if the array is empty or not!
+ // Otherwise empty arrays will always pass validation.
+ if (is_array($postdata) && ! empty($postdata))
{
foreach ($postdata as $key => $val)
{