From f1558cd1c5145ed85c126a8dde2205bb8368c81e Mon Sep 17 00:00:00 2001 From: Nate Jones Date: Tue, 30 Sep 2014 09:22:29 +0000 Subject: [PATCH] Functions: Corrected logic in valid_email(). --- resources/functions.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/functions.php b/resources/functions.php index fab9c3cd05..8c5997bc67 100644 --- a/resources/functions.php +++ b/resources/functions.php @@ -976,11 +976,11 @@ function number_pad($number,$n) { if(!function_exists('validate_email')) { function valid_email($email) { $regex = '/^[A-z0-9][\w.-]*@[A-z0-9][\w\-\.]+\.[A-z0-9]{2,6}$/'; - if ($email != "" && preg_match($regex, $email) == 0) { - return false; // email address does not have valid syntax + if ($email != "" && preg_match($regex, $email) == 1) { + return true; // email address has valid syntax } else { - return true; // email address has valid syntax + return false; // email address does not have valid syntax } } }