From 642a864eeab09eb36b91de9a12073741287ac71c Mon Sep 17 00:00:00 2001 From: Nozomi Anzai Date: Fri, 16 Jul 2010 05:04:41 +0000 Subject: [PATCH] Remove preg_match() after is_numeric() in checking if a integer value is valid. --- pgconfig.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/pgconfig.php b/pgconfig.php index 8e70e97..e1a8e26 100644 --- a/pgconfig.php +++ b/pgconfig.php @@ -328,12 +328,10 @@ function checkInteger($str, $min, $max) if(is_numeric($str)) { $minLen = strlen($min); $maxLen = strlen($max); - if(preg_match('/^[0-9]{'.$minLen.','.$maxLen.'}$/', $str)) { - if($str < $min || $str > $max) { - return false; - } else { - return true; - } + if($str < $min || $str > $max) { + return false; + } else { + return true; } } return false; -- 2.39.5