From fd1f152e55449d385d3cb3a57272e7de44f481ea Mon Sep 17 00:00:00 2001 From: Ruben Date: Wed, 14 Jan 2026 20:25:59 +0100 Subject: [PATCH] Update email validation to return false for invalid addresses Fix email validation to properly handle invalid addresses by returning false --- custom/vendor/PHPMailer.Lite.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/custom/vendor/PHPMailer.Lite.php b/custom/vendor/PHPMailer.Lite.php index c951fb5..8a15dde 100644 --- a/custom/vendor/PHPMailer.Lite.php +++ b/custom/vendor/PHPMailer.Lite.php @@ -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;