summaryrefslogtreecommitdiff
path: root/includes/common.inc
diff options
context:
space:
mode:
Diffstat (limited to 'includes/common.inc')
-rw-r--r--includes/common.inc7
1 files changed, 1 insertions, 6 deletions
diff --git a/includes/common.inc b/includes/common.inc
index 33109f00e..69227435e 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -866,12 +866,7 @@ function t($string, $args = array(), $langcode = NULL) {
* TRUE if the address is in a valid format.
*/
function valid_email_address($mail) {
- $user = '[a-zA-Z0-9_\-\.\+\^!#\$%&*+\/\=\?\`\|\{\}~\']+';
- $domain = '(?:(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.?)+';
- $ipv4 = '[0-9]{1,3}(\.[0-9]{1,3}){3}';
- $ipv6 = '[0-9a-fA-F]{1,4}(\:[0-9a-fA-F]{1,4}){7}';
-
- return (bool)preg_match("/^$user@($domain|(\[($ipv4|$ipv6)\]))$/", $mail);
+ return (bool)filter_var($mail, FILTER_VALIDATE_EMAIL);
}
/**