From 8d6c8fecce7f1cb4bcd7a196ec77748d5e33e689 Mon Sep 17 00:00:00 2001 From: bjjay Date: Mon, 9 Mar 2015 13:46:06 +0800 Subject: Reduce once MB_ENABLED checking The checking is done in the compat file system/core/compat/mbstring.php --- system/libraries/Form_validation.php | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'system') diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php index f161b40e7..9d1660258 100644 --- a/system/libraries/Form_validation.php +++ b/system/libraries/Form_validation.php @@ -1151,9 +1151,7 @@ class CI_Form_validation { return FALSE; } - return (MB_ENABLED === TRUE) - ? ($val <= mb_strlen($str)) - : ($val <= strlen($str)); + return ($val <= mb_strlen($str)); } // -------------------------------------------------------------------- @@ -1172,9 +1170,7 @@ class CI_Form_validation { return FALSE; } - return (MB_ENABLED === TRUE) - ? ($val >= mb_strlen($str)) - : ($val >= strlen($str)); + return ($val >= mb_strlen($str)); } // -------------------------------------------------------------------- @@ -1193,9 +1189,7 @@ class CI_Form_validation { return FALSE; } - return (MB_ENABLED === TRUE) - ? (mb_strlen($str) === (int) $val) - : (strlen($str) === (int) $val); + return (mb_strlen($str) === (int) $val); } // -------------------------------------------------------------------- -- cgit v1.2.3-24-g4f1b