From e36a6dcebe3bf2abddf9600e94bbdb606bf904e3 Mon Sep 17 00:00:00 2001 From: Exile Date: Tue, 26 Aug 2014 00:12:09 +0400 Subject: [PATCH] Validate email MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Новая валидация email-адресов. --- upload/includes/functions_validate.php | 2 +- upload/templates/default/page_header.tpl | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/upload/includes/functions_validate.php b/upload/includes/functions_validate.php index 6f47589bb..84386276e 100644 --- a/upload/includes/functions_validate.php +++ b/upload/includes/functions_validate.php @@ -74,7 +74,7 @@ function validate_email ($email, $check_ban_and_taken = true) { global $lang, $userdata; - if (!$email || !preg_match('#^([_a-z\d])[a-z\d\.\-_]+@[a-z\d\-]+\.([a-z\d\-]+\.)*?[a-z]{2,4}$#i', $email)) + if (!$email || !filter_var($email, FILTER_VALIDATE_EMAIL)) { return $lang['EMAIL_INVALID']; } diff --git a/upload/templates/default/page_header.tpl b/upload/templates/default/page_header.tpl index 4e9874f67..2819a000c 100644 --- a/upload/templates/default/page_header.tpl +++ b/upload/templates/default/page_header.tpl @@ -316,9 +316,9 @@ $(document).ready(function() {