From 2648ef26727193d299ef5af2acb2bcc3d21def67 Mon Sep 17 00:00:00 2001 From: Nate Date: Sat, 18 Apr 2020 16:47:46 -0600 Subject: [PATCH] Functions: Increase TLD character length on email address validation. --- resources/functions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/functions.php b/resources/functions.php index a954b71943..6bb3113db6 100644 --- a/resources/functions.php +++ b/resources/functions.php @@ -1019,7 +1019,7 @@ function number_pad($number,$n) { // validate email address syntax if(!function_exists('valid_email')) { function valid_email($email) { - $regex = '/^[A-z0-9][\w.-]*@[A-z0-9][\w\-\.]+(\.[A-z0-9]{2,6})?$/'; + $regex = '/^[A-z0-9][\w.-]*@[A-z0-9][\w\-\.]+(\.[A-z0-9]{2,7})?$/'; if ($email != "" && preg_match($regex, $email) == 1) { return true; // email address has valid syntax } @@ -1349,7 +1349,7 @@ function number_pad($number,$n) { include_once("resources/phpmailer/class.phpmailer.php"); include_once("resources/phpmailer/class.smtp.php"); - $regexp = '/^[A-z0-9][\w.-]*@[A-z0-9][\w\-\.]+\.[A-z0-9]{2,6}$/'; + $regexp = '/^[A-z0-9][\w.-]*@[A-z0-9][\w\-\.]+\.[A-z0-9]{2,7}$/'; $mail = new PHPMailer(); $mail -> IsSMTP();