summaryrefslogtreecommitdiffstats
path: root/system/libraries/Form_validation.php
diff options
context:
space:
mode:
authorftwbzhao <b.zhao1@gmail.com>2015-04-09 16:32:41 +0200
committerftwbzhao <b.zhao1@gmail.com>2015-04-09 16:32:41 +0200
commitb587698dd45396b91106bd7c894a79747b1fb7a9 (patch)
tree76a1d614976dd0b695e513a40f9235e3b9f7f82c /system/libraries/Form_validation.php
parent9b9a06c9635cd3b4fce0aebe4d2eead4809999a5 (diff)
parentfd363f224d7886eb686434d7a835eaa49183d8e6 (diff)
Merge branch 'develop' of https://github.com/bcit-ci/CodeIgniter into develop
Diffstat (limited to 'system/libraries/Form_validation.php')
-rw-r--r--system/libraries/Form_validation.php12
1 files changed, 5 insertions, 7 deletions
diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php
index 05de59628..522eba704 100644
--- a/system/libraries/Form_validation.php
+++ b/system/libraries/Form_validation.php
@@ -198,22 +198,20 @@ class CI_Form_validation {
return $this;
}
- // No fields? Nothing to do...
- if ( ! is_string($field) OR $field === '')
+ // No fields or no rules? Nothing to do...
+ if ( ! is_string($field) OR $field === '' OR empty($rules))
{
return $this;
}
elseif ( ! is_array($rules))
{
// BC: Convert pipe-separated rules string to an array
- if (is_string($rules))
- {
- $rules = explode('|', $rules);
- }
- else
+ if ( ! is_string($rules))
{
return $this;
}
+
+ $rules = explode('|', $rules);
}
// If the field label wasn't passed we use the field name