mirror of
https://github.com/typecho/typecho.git
synced 2025-01-16 20:18:19 +01:00
fix email validate
This commit is contained in:
parent
c9de1b3b01
commit
7a41f0d013
@ -96,7 +96,8 @@ class Validate
|
||||
*/
|
||||
public static function email(string $str): bool
|
||||
{
|
||||
return (bool) preg_match("/^[_a-z0-9-\.]+@([-a-z0-9]+\.)+[a-z]{2,}$/i", $str);
|
||||
$email = filter_var($str, FILTER_SANITIZE_EMAIL);
|
||||
return filter_var($str, FILTER_VALIDATE_EMAIL) && ($email === $str);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user