diff options
author | Andrey Andreev <narf@bofh.bg> | 2012-03-13 11:10:12 +0100 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2012-03-13 11:10:12 +0100 |
commit | 60138567c58dd924e2240973e34f0e3903a7ef2b (patch) | |
tree | 533c1dd40f69a534c0b03e8c327011427e458bd8 /system/libraries/Form_validation.php | |
parent | 7203d54604a372fd8dd0b30bd8d4cdbd0af738bc (diff) | |
parent | dbf4a5ad7b279b2833484e30f1168032cea9b7d3 (diff) |
Merge upstream branch
Diffstat (limited to 'system/libraries/Form_validation.php')
-rw-r--r-- | system/libraries/Form_validation.php | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php index bd8b7c216..9491f354c 100644 --- a/system/libraries/Form_validation.php +++ b/system/libraries/Form_validation.php @@ -2,7 +2,7 @@ /** * CodeIgniter * - * An open source application development framework for PHP 5.1.6 or newer + * An open source application development framework for PHP 5.2.4 or newer * * NOTICE OF LICENSE * @@ -53,6 +53,18 @@ class CI_Form_validation { { $this->CI =& get_instance(); + // applies delimiters set in config file. + if (isset($rules['error_prefix'])) + { + $this->_error_prefix = $rules['error_prefix']; + unset($rules['error_prefix']); + } + if (isset($rules['error_suffix'])) + { + $this->_error_suffix = $rules['error_suffix']; + unset($rules['error_suffix']); + } + // Validation rules can be stored in a config file. $this->_config_rules = $rules; @@ -60,7 +72,7 @@ class CI_Form_validation { $this->CI->load->helper('form'); // Set the character encoding in MB. - if (function_exists('mb_internal_encoding')) + if (MB_ENABLED === TRUE) { mb_internal_encoding($this->CI->config->item('charset')); } @@ -938,7 +950,7 @@ class CI_Form_validation { return FALSE; } - if (function_exists('mb_strlen')) + if (MB_ENABLED === TRUE) { return ! (mb_strlen($str) < $val); } @@ -962,7 +974,7 @@ class CI_Form_validation { return FALSE; } - if (function_exists('mb_strlen')) + if (MB_ENABLED === TRUE) { return ! (mb_strlen($str) > $val); } @@ -986,7 +998,7 @@ class CI_Form_validation { return FALSE; } - if (function_exists('mb_strlen')) + if (MB_ENABLED === TRUE) { return (mb_strlen($str) == $val); } |