From 6643b386269830ce6a7e7ba646f3802aed400759 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Mon, 21 Mar 2016 16:03:22 +0800 Subject: [PATCH] =?UTF-8?q?validate=E8=87=AA=E5=AE=9A=E4=B9=89=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E4=BF=A1=E6=81=AF=E6=94=AF=E6=8C=81=E6=95=B0=E7=BB=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Validate.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/library/think/Validate.php b/library/think/Validate.php index c5efadb9..5c20c1c5 100644 --- a/library/think/Validate.php +++ b/library/think/Validate.php @@ -244,7 +244,11 @@ class Validate // [field,rule1|rule2,msg1|msg2] $key = $item[0]; $rule = $item[1]; - $msg = isset($item[2]) ? explode('|', $item[2]) : []; + if (isset($item[2])) { + $msg = is_string($item[2]) ? explode('|', $item[2]) : $item[2]; + } else { + $msg = []; + } } else { $rule = $item; $msg = [];