diff options
author | admin <devnull@localhost> | 2006-10-06 04:10:23 +0200 |
---|---|---|
committer | admin <devnull@localhost> | 2006-10-06 04:10:23 +0200 |
commit | c5f7fa3f8fea283b51ee6cd80b36b2112b2e81db (patch) | |
tree | b5ce6b140d38dba5288fbcc1eed0971d556b5ad8 /system/libraries/Validation.php | |
parent | 5294f4f36aeb3b7685781708ce78ab28f1785764 (diff) |
Diffstat (limited to 'system/libraries/Validation.php')
-rw-r--r-- | system/libraries/Validation.php | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/system/libraries/Validation.php b/system/libraries/Validation.php index 7db67a3e1..ff5970837 100644 --- a/system/libraries/Validation.php +++ b/system/libraries/Validation.php @@ -65,18 +65,25 @@ class CI_Validation { function set_fields($data = '', $field = '') { if ($data == '') - return; - - if ( ! is_array($data)) { - if ($field == '') - return; - - $data = array($data => $field); + if (count($this->_fields) == 0) + { + return FALSE; + } } - - $this->_fields = $data; - + else + { + if ( ! is_array($data)) + { + $data = array($data => $field); + } + + if (count($data) > 0) + { + $this->_fields = $data; + } + } + foreach($this->_fields as $key => $val) { $this->$key = ( ! isset($_POST[$key]) OR is_array($_POST[$key])) ? '' : $this->prep_for_form($_POST[$key]); |