summaryrefslogtreecommitdiffstats
path: root/system/libraries/Form_validation.php
diff options
context:
space:
mode:
authorzoaked <zoaked@users.noreply.github.com>2015-09-21 04:29:13 +0200
committerzoaked <zoaked@users.noreply.github.com>2015-09-21 04:29:13 +0200
commitf1ca7661ed6479a0f53b20ec5e704321b3e47fcf (patch)
tree8d4230718e1478e4373fd8305bffe0a95d44e7e1 /system/libraries/Form_validation.php
parent60858b65a4be78b1d384492588b52e98fd644403 (diff)
Switch from saving copy of config to reset method parameter
Diffstat (limited to 'system/libraries/Form_validation.php')
-rw-r--r--system/libraries/Form_validation.php9
1 files 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 = '';