From eccde13b8ae8be69645cf1abedcdbdc3c278b615 Mon Sep 17 00:00:00 2001 From: Michiel Vugteveen Date: Thu, 14 Jun 2012 23:22:26 +0200 Subject: exact length passed as string needs to be casted to int --- system/libraries/Form_validation.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'system') diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php index 6cbe032c7..069751b45 100644 --- a/system/libraries/Form_validation.php +++ b/system/libraries/Form_validation.php @@ -1035,7 +1035,7 @@ class CI_Form_validation { * Exact Length * * @param string - * @param int + * @param string * @return bool */ public function exact_length($str, $val) @@ -1045,6 +1045,8 @@ class CI_Form_validation { return FALSE; } + $val = (int) $val; + return (MB_ENABLED === TRUE) ? (mb_strlen($str) === $val) : (strlen($str) === $val); -- cgit v1.2.3-24-g4f1b