summaryrefslogtreecommitdiffstats
path: root/system/libraries/Form_validation.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-03-13 11:51:33 +0100
committerAndrey Andreev <narf@bofh.bg>2012-03-13 11:51:33 +0100
commitc1cda232d690723db6e704b738c91f84cfc49a9e (patch)
treea7e91130e3b6139f5ce9f515635863eee457cb7e /system/libraries/Form_validation.php
parent30da39bb5d65c37203c12a42dfc50f7d231fb2d1 (diff)
parentd153002858256c6f206c8877f4952ed075902f9e (diff)
Merge upstream branch
Diffstat (limited to 'system/libraries/Form_validation.php')
-rw-r--r--system/libraries/Form_validation.php20
1 files changed, 16 insertions, 4 deletions
diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php
index 4ad31ebfa..9491f354c 100644
--- a/system/libraries/Form_validation.php
+++ b/system/libraries/Form_validation.php
@@ -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);
}