diff options
author | Dries Buytaert <dries@buytaert.net> | 2001-04-19 19:54:37 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2001-04-19 19:54:37 +0000 |
commit | a6e6dfb9219ebea34331ad46c9c43d53f7c3ca6f (patch) | |
tree | e4939696a62e748dbe7732480b62c7a1399be94b /includes/function.inc | |
parent | 78cd8cda097f6c6361090980f0664bbf939dafdd (diff) | |
download | brdo-a6e6dfb9219ebea34331ad46c9c43d53f7c3ca6f.tar.gz brdo-a6e6dfb9219ebea34331ad46c9c43d53f7c3ca6f.tar.bz2 |
- 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).
Diffstat (limited to 'includes/function.inc')
-rw-r--r-- | includes/function.inc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/includes/function.inc b/includes/function.inc index 8a2a73604..fe792d43c 100644 --- a/includes/function.inc +++ b/includes/function.inc @@ -28,6 +28,14 @@ function check_code($message) { return $message; } +function check_mail($mail) { + return eregi("^[_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3}$", $mail) ? 1 : 0; +} + +function check_name($name) { + return ereg("[^a-zA-Z0-9_-]", $name) ? 0 : 1; +} + function check_output($message, $nl2br = 0) { global $allowed_html, $na; $var = strip_tags(stripslashes(format_text($message)), $allowed_html); |