summaryrefslogtreecommitdiffstats
path: root/system/libraries/Form_validation.php
diff options
context:
space:
mode:
authorRick Ellis <rick.ellis@ellislab.com>2008-10-17 08:55:01 +0200
committerRick Ellis <rick.ellis@ellislab.com>2008-10-17 08:55:01 +0200
commit29828ac05fb45c0f0776cd5d2d39fb15de956823 (patch)
treedd219ef9d25944f295966b795db2f4f1bda99c5a /system/libraries/Form_validation.php
parentd590ca500b246a50393d6e7b6d9266611ae6d78d (diff)
Fixed an undefined variable. Bug #5311
Diffstat (limited to 'system/libraries/Form_validation.php')
-rw-r--r--system/libraries/Form_validation.php25
1 files changed, 23 insertions, 2 deletions
diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php
index 4bbb6f2dd..4f3ffd0d3 100644
--- a/system/libraries/Form_validation.php
+++ b/system/libraries/Form_validation.php
@@ -50,7 +50,13 @@ class CI_Form_validation {
// Automatically load the form helper
$this->CI->load->helper('form');
-
+
+ // Set the character encoding in MB.
+ if (function_exists('mb_internal_encoding'))
+ {
+ mb_internal_encoding($this->CI->config->item('charset'));
+ }
+
log_message('debug', "Validation Class Initialized");
}
@@ -514,7 +520,7 @@ class CI_Form_validation {
}
else
{
- $line = $this->_error_messages[$rule];
+ $line = $this->_error_messages['isset'];
}
// Build the error message
@@ -912,6 +918,11 @@ class CI_Form_validation {
{
return FALSE;
}
+
+ if (function_exists('mb_strlen'))
+ {
+ return (mb_strlen($str) < $val) ? FALSE : TRUE;
+ }
return (strlen($str) < $val) ? FALSE : TRUE;
}
@@ -932,6 +943,11 @@ class CI_Form_validation {
{
return FALSE;
}
+
+ if (function_exists('mb_strlen'))
+ {
+ return (mb_strlen($str) > $val) ? FALSE : TRUE;
+ }
return (strlen($str) > $val) ? FALSE : TRUE;
}
@@ -952,6 +968,11 @@ class CI_Form_validation {
{
return FALSE;
}
+
+ if (function_exists('mb_strlen'))
+ {
+ return (mb_strlen($str) != $val) ? FALSE : TRUE;
+ }
return (strlen($str) != $val) ? FALSE : TRUE;
}