summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2013-07-22 09:13:26 +0200
committerAndrey Andreev <narf@devilix.net>2013-07-22 09:13:26 +0200
commitc3c931baec6a9c446765d5b474e5e26cd37e2262 (patch)
treeecf15010ca69ba2645f5224b436c4cfe016b2377 /system
parentd4c8f84096ca976f13f8c63572b7297f9958a4bd (diff)
parent05370bf751aa6b7885ee548de6f6f2c14571765a (diff)
Merge pull request #2547 from HashemQolami/patch-1
Fix Form Validation issue with text inputs which have array as name
Diffstat (limited to 'system')
-rw-r--r--system/libraries/Form_validation.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php
index 40ba01202..8b9bfa897 100644
--- a/system/libraries/Form_validation.php
+++ b/system/libraries/Form_validation.php
@@ -583,7 +583,7 @@ class CI_Form_validation {
// If the field is blank, but NOT required, no further tests are necessary
$callback = FALSE;
- if ( ! in_array('required', $rules) && $postdata === NULL)
+ if ( ! in_array('required', $rules) && ($postdata === NULL OR $postdata === ''))
{
// Before we bail out, does the rule contain a callback?
if (preg_match('/(callback_\w+(\[.*?\])?)/', implode(' ', $rules), $match))
@@ -598,7 +598,7 @@ class CI_Form_validation {
}
// Isset Test. Typically this rule will only apply to checkboxes.
- if ($postdata === NULL && $callback === FALSE)
+ if (($postdata === NULL OR $postdata === '') && $callback === FALSE)
{
if (in_array('isset', $rules, TRUE) OR in_array('required', $rules))
{