From 28747aa5dcc59d7957fb61476fbb023be0e96352 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Thu, 12 Jan 2017 13:29:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9BValidate=E7=B1=BB=E7=9A=84?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E4=BF=A1=E6=81=AF=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Validate.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/think/Validate.php b/library/think/Validate.php index e3bc9db6..e91ee338 100644 --- a/library/think/Validate.php +++ b/library/think/Validate.php @@ -1222,9 +1222,9 @@ class Validate $msg = Lang::get(substr($msg, 2, -1)); } - if (is_string($msg) && is_string($rule) && false !== strpos($msg, ':')) { + if (is_string($msg) && is_scalar($rule) && false !== strpos($msg, ':')) { // 变量替换 - if (strpos($rule, ',')) { + if (is_string($rule) && strpos($rule, ',')) { $array = array_pad(explode(',', $rule), 3, ''); } else { $array = array_pad([], 3, '');