diff options
-rw-r--r-- | system/libraries/Form_validation.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php index af90316a4..a2991395c 100644 --- a/system/libraries/Form_validation.php +++ b/system/libraries/Form_validation.php @@ -68,6 +68,7 @@ class CI_Form_validation { * @var array */ protected $_config_rules = array(); + private $_default_config_rules = array(); /** * Array of validation errors @@ -141,7 +142,7 @@ class CI_Form_validation { } // Validation rules can be stored in a config file. - $this->_config_rules = $rules; + $this->_default_config_rules = $this->_config_rules = $rules; // Automatically load the form helper $this->CI->load->helper('form'); @@ -1586,7 +1587,7 @@ class CI_Form_validation { public function reset_validation() { $this->_field_data = array(); - $this->_config_rules = array(); + $this->_config_rules = $this->_default_config_rules; $this->_error_array = array(); $this->_error_messages = array(); $this->error_string = ''; |