From 29828ac05fb45c0f0776cd5d2d39fb15de956823 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Fri, 17 Oct 2008 06:55:01 +0000 Subject: Fixed an undefined variable. Bug #5311 --- system/libraries/Form_validation.php | 25 +++++++++++++++++++++++-- 1 file 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; } -- cgit v1.2.3-24-g4f1b