From a6e6dfb9219ebea34331ad46c9c43d53f7c3ca6f Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Thu, 19 Apr 2001 19:54:37 +0000 Subject: - Addition: added 2 new functions check_mail() and check_name() to functions.inc useful for resp. verifying an e-mail address and username: currently used by account.php - but reusable by Julian's refer.module for example (prepares integration). --- account.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'account.php') diff --git a/account.php b/account.php index 3146e7f95..1e96f1f9d 100644 --- a/account.php +++ b/account.php @@ -296,8 +296,8 @@ function account_user($uname) { function account_validate($user) { // Verify username and e-mail address: - if (empty($user[real_email]) || (!eregi("^[_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3}$", $user[real_email]))) $error = t("the e-mail address '$user[real_email]' is not valid"); - if (empty($user[userid]) || (ereg("[^a-zA-Z0-9_-]", $user[userid]))) $error = t("the username '$user[userid]' is not valid"); + if (empty($user[real_email]) || (!check_mail($user[real_email]))) $error = t("the e-mail address '$user[real_email]' is not valid"); + if (empty($user[userid]) || (!check_name($user[userid]))) $error = t("the username '$user[userid]' is not valid"); if (strlen($user[userid]) > 15) $error = t("the username '$user[userid]' is too long: it must be less than 15 characters"); // Check to see whether the username or e-mail address are banned: -- cgit v1.2.3