diff options
author | Felix Favre <felix.favre@protonet.info> | 2015-08-26 15:19:22 +0200 |
---|---|---|
committer | Felix Favre <felix.favre@protonet.info> | 2015-08-26 15:24:33 +0200 |
commit | ecf25f5d2a1793671474fb9dfe816001b98b4770 (patch) | |
tree | 51c5fdb2e6e9936b402ba5f93bd7e0a99d922b97 | |
parent | 73208016bfb9c933c40a832c1895f38c8bf3f0c6 (diff) |
replace overcomplicated regex for email validation with php function
-rw-r--r-- | includes/sys_page.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/includes/sys_page.php b/includes/sys_page.php index f9ee0ea6..967a0172 100644 --- a/includes/sys_page.php +++ b/includes/sys_page.php @@ -43,7 +43,7 @@ function strip_item($item) { * Überprüft eine E-Mail-Adresse. */ function check_email($email) { - return (bool) preg_match("#^([a-zA-Z0-9_+\-])+(\.([a-zA-Z0-9_+\-])+)*@((\[(((([0-1])?([0-9])?[0-9])|(2[0-4][0-9])|(2[0-5][0-5])))\.(((([0-1])?([0-9])?[0-9])|(2[0-4][0-9])|(2[0-5][0-5])))\.(((([0-1])?([0-9])?[0-9])|(2[0-4][0-9])|(2[0-5][0-5])))\.(((([0-1])?([0-9])?[0-9])|(2[0-4][0-9])|(2[0-5][0-5]))\]))|((([\p{L}0-9])+(([\-])+([\p{L}0-9])+)*\.)+([\p{L}])+(([\-])+([\p{L}0-9])+)*))$#u", $email); + return (bool) filter_var($email, FILTER_VALIDATE_EMAIL); } ?> |