Skip to content

Commit 91c6540

Browse files
committed
Use filer_var to check email
1 parent 0e7d21b commit 91c6540

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

featherbb/Core/Email.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ class Email
1919
//
2020
public function isValidEmail($email)
2121
{
22-
if (strlen($email) > 80) {
23-
return false;
22+
if (filter_var($email, FILTER_VALIDATE_EMAIL)) {
23+
return true;
2424
}
2525

26-
return preg_match('%^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|("[^"]+"))@((\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\])|(([a-zA-Z\d\-]+\.)+[a-zA-Z]{2,}))$%', $email);
26+
return false;
2727
}
2828

2929

0 commit comments

Comments
 (0)