diff --git a/library/think/Validate.php b/library/think/Validate.php index cb113bc2..d68811f0 100644 --- a/library/think/Validate.php +++ b/library/think/Validate.php @@ -1215,7 +1215,7 @@ class Validate $msg = Lang::get(substr($msg, 2, -1)); } - if (is_string($msg) && false !== strpos($msg, ':')) { + if (is_string($msg) && is_string($rule) && false !== strpos($msg, ':')) { // 变量替换 if (strpos($rule, ',')) { $array = array_pad(explode(',', $rule), 3, '');