mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 15:12:48 +08:00
改进验证方法
This commit is contained in:
@@ -1195,7 +1195,7 @@ class Validate
|
|||||||
// 不是正则表达式则两端补上/
|
// 不是正则表达式则两端补上/
|
||||||
$rule = '/^' . $rule . '$/';
|
$rule = '/^' . $rule . '$/';
|
||||||
}
|
}
|
||||||
return 1 === preg_match($rule, (string) $value);
|
return is_scalar($value) && 1 === preg_match($rule, (string) $value);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user