From c19d404606f1120d7fb137c72e1a176623868c16 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Wed, 10 Aug 2016 19:58:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9BValidate=E7=B1=BB=E7=9A=84num?= =?UTF-8?q?ber=E9=AA=8C=E8=AF=81=E8=A7=84=E5=88=99=20=E5=92=8C=20integer?= =?UTF-8?q?=E5=8C=BA=E5=88=86=E5=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Validate.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/library/think/Validate.php b/library/think/Validate.php index 857a9933..d7b33d9d 100644 --- a/library/think/Validate.php +++ b/library/think/Validate.php @@ -541,6 +541,8 @@ class Validate $result = $this->filter($value, FILTER_VALIDATE_FLOAT); break; case 'number': + $result = is_numeric($value); + break; case 'integer': // 是否为整形 $result = $this->filter($value, FILTER_VALIDATE_INT);