改进Validate的getRuleMsg方法

This commit is contained in:
thinkphp
2016-12-13 14:29:24 +08:00
parent 7775dd9255
commit f77a48930a

View File

@@ -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, '');