summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
authorMichiel Vugteveen <michiel@it-can.nl>2012-06-14 23:22:26 +0200
committerMichiel Vugteveen <michiel@it-can.nl>2012-06-14 23:22:26 +0200
commiteccde13b8ae8be69645cf1abedcdbdc3c278b615 (patch)
tree527de0cd85715d018786f61afc23ebf32228cc01 /system
parentf11a1939c25de1e327c7c02001c8fbd1ec1fc7b4 (diff)
exact length passed as string needs to be casted to int
Diffstat (limited to 'system')
-rw-r--r--system/libraries/Form_validation.php4
1 files changed, 3 insertions, 1 deletions
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);