From c8711031a38ed7eed6d5a62ab93fe19380db5bbc Mon Sep 17 00:00:00 2001 From: thinkphp Date: Wed, 7 Mar 2018 18:34:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B=E9=AA=8C=E8=AF=81=E6=96=B9?= =?UTF-8?q?=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Validate.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/think/Validate.php b/library/think/Validate.php index 60ec7d3b..6226892c 100644 --- a/library/think/Validate.php +++ b/library/think/Validate.php @@ -1195,7 +1195,7 @@ class Validate // 不是正则表达式则两端补上/ $rule = '/^' . $rule . '$/'; } - return 1 === preg_match($rule, (string) $value); + return is_scalar($value) && 1 === preg_match($rule, (string) $value); } /**