From f1ca7661ed6479a0f53b20ec5e704321b3e47fcf Mon Sep 17 00:00:00 2001 From: zoaked Date: Sun, 20 Sep 2015 22:29:13 -0400 Subject: Switch from saving copy of config to reset method parameter --- system/libraries/Form_validation.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php index a2991395c..aca1d1da9 100644 --- a/system/libraries/Form_validation.php +++ b/system/libraries/Form_validation.php @@ -68,7 +68,6 @@ class CI_Form_validation { * @var array */ protected $_config_rules = array(); - private $_default_config_rules = array(); /** * Array of validation errors @@ -142,7 +141,7 @@ class CI_Form_validation { } // Validation rules can be stored in a config file. - $this->_default_config_rules = $this->_config_rules = $rules; + $this->_config_rules = $rules; // Automatically load the form helper $this->CI->load->helper('form'); @@ -1582,12 +1581,14 @@ class CI_Form_validation { * Prevents subsequent validation routines from being affected by the * results of any previous validation routine due to the CI singleton. * + * @param bool * @return CI_Form_validation */ - public function reset_validation() + public function reset_validation($keep_config=false) { $this->_field_data = array(); - $this->_config_rules = $this->_default_config_rules; + if( ! $keep_config) + $this->_config_rules = array(); $this->_error_array = array(); $this->_error_messages = array(); $this->error_string = ''; -- cgit v1.2.3-24-g4f1b