改进Validate类的boolean验证规则 支持表单数据

This commit is contained in:
thinkphp
2016-08-02 18:04:40 +08:00
parent 5e92ac83c9
commit 53f6d41ef4

View File

@@ -551,7 +551,7 @@ class Validate
break; break;
case 'boolean': case 'boolean':
// 是否为布尔值 // 是否为布尔值
$result = $this->filter($value, FILTER_VALIDATE_BOOLEAN); $result = in_array($value, ['true', 'false', 0, 1, true, false]);
break; break;
case 'array': case 'array':
// 是否为数组 // 是否为数组