diff options
author | Kevin Wood-Friend <kwoodfriend@hawthornpublications.com> | 2012-06-12 15:54:01 +0200 |
---|---|---|
committer | Kevin Wood-Friend <kwoodfriend@hawthornpublications.com> | 2012-06-12 15:54:20 +0200 |
commit | 6a56d50cc03ec74a905718e711b48253cc267f00 (patch) | |
tree | 0759a61c215912cb68ba47fe357049f70b321577 | |
parent | 4e9538fe19b09c0dc588542cfb7f793348b83bf7 (diff) |
Modified Form Validation class's set_rules() so it can now handle an array of rules, instead of just a string
-rw-r--r-- | system/libraries/Form_validation.php | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php index 77c968e7c..6cbe032c7 100644 --- a/system/libraries/Form_validation.php +++ b/system/libraries/Form_validation.php @@ -187,6 +187,12 @@ class CI_Form_validation { return $this; } + // Convert an array of rules to a string + if (is_array($rules)) + { + $rules = implode('|', $rules); + } + // No fields? Nothing to do... if ( ! is_string($field) OR ! is_string($rules) OR $field === '') { |