mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2025-12-30 09:03:49 +00:00
Functions: Corrected logic in valid_email().
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user