Update email validation to return false for invalid addresses
Fix email validation to properly handle invalid addresses by returning false
This commit is contained in:
parent
b1f19e2cdd
commit
fd1f152e55
1 changed files with 3 additions and 2 deletions
5
custom/vendor/PHPMailer.Lite.php
vendored
5
custom/vendor/PHPMailer.Lite.php
vendored
|
|
@ -613,9 +613,10 @@ class PHPMailerLite
|
|||
{
|
||||
if (!empty($str) && is_string($str)) {
|
||||
preg_match('/[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,9}/', $str, $bk);
|
||||
if (!empty($bk[0])) {
|
||||
$email = $bk[0];
|
||||
if (empty($bk[0])) {
|
||||
return false;
|
||||
}
|
||||
$email = $bk[0];
|
||||
$email = str_ireplace(["\r", "\n", "\t", '"', ",", "<", ">"], "", $email);
|
||||
if (filter_var($email, FILTER_VALIDATE_EMAIL) && self::IsValidEmail($email)) {
|
||||
return $email;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue