From e2b12332693c60be6c9954de5f3d7b5fe91d0423 Mon Sep 17 00:00:00 2001 From: David Goodwin Date: Sat, 10 Feb 2018 20:56:56 +0000 Subject: [PATCH] Use filter_var($x, FILTER_VALIDATE_EMAIL) as an extra check if we can in check_email(...) --- functions.inc.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/functions.inc.php b/functions.inc.php index 150f0e13..cb950bfc 100644 --- a/functions.inc.php +++ b/functions.inc.php @@ -277,6 +277,12 @@ function check_email($email) { return Config::lang_f('pInvalidMailRegex', $email); } + if(function_exists('filter_var')) { + $check = filter_var($email, FILTER_VALIDATE_EMAIL); + if(!$check) { + return Config::lang_f('pInvalidMailRegex', $email); + } + } // Determine domain name $matches=array(); if (!preg_match('|@(.+)$|', $ce_email, $matches)) {