summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2001-04-19 19:54:37 +0000
committerDries Buytaert <dries@buytaert.net>2001-04-19 19:54:37 +0000
commita6e6dfb9219ebea34331ad46c9c43d53f7c3ca6f (patch)
treee4939696a62e748dbe7732480b62c7a1399be94b /includes
parent78cd8cda097f6c6361090980f0664bbf939dafdd (diff)
downloadbrdo-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')
-rw-r--r--includes/function.inc8
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);