改进闭包验证的参数

This commit is contained in:
thinkphp
2018-10-24 16:57:05 +08:00
parent b0514ee54c
commit 15f665b2b1

View File

@@ -315,8 +315,8 @@ class Validate
// 字段验证
if ($rule instanceof \Closure) {
// 匿名函数验证 支持传入当前字段和所有字段两个数据
$result = call_user_func_array($rule, [$value, $data]);
// 匿名函数验证
$result = call_user_func_array($rule, [$value, $data, $title, $msg, $this]);
} else {
$result = $this->checkItem($key, $value, $rule, $data, $title, $msg);
}