diff --git a/library/think/Validate.php b/library/think/Validate.php index 60ec7d3b..6226892c 100644 --- a/library/think/Validate.php +++ b/library/think/Validate.php @@ -1195,7 +1195,7 @@ class Validate // 不是正则表达式则两端补上/ $rule = '/^' . $rule . '$/'; } - return 1 === preg_match($rule, (string) $value); + return is_scalar($value) && 1 === preg_match($rule, (string) $value); } /**