diff --git a/include/functions.php b/include/functions.php index fd395a6a..314f3b49 100644 --- a/include/functions.php +++ b/include/functions.php @@ -2316,7 +2316,7 @@ function validfilename($name) { } function validemail($email) { - return preg_match('/^[\w.-]+@([\w.-]+\.)+[a-z]{2,6}$/is', $email); + return filter_var($email, FILTER_VALIDATE_EMAIL) !== false; } function validlang($langid) { diff --git a/public/usersearch.php b/public/usersearch.php index 2afd2c1b..69c2d5f9 100644 --- a/public/usersearch.php +++ b/public/usersearch.php @@ -311,7 +311,7 @@ if (count($_GET) > 0 && !$_GET['h']) if (strpos($email,'*') === False && strpos($email,'?') === False && strpos($email,'%') === False) { - if (validemail($email) !== 1) + if (!validemail($email)) { stdmsg("Error", "Bad email."); stdfoot();