summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDries Buytaert2003-06-25 15:44:30 +0000
committerDries Buytaert2003-06-25 15:44:30 +0000
commitd50941ce25ee8c7586bd98ccbf8892190a8d3052 (patch)
tree2fcbf77486c34cfbda92d130a378b1f1fe46e09d
parentd7b29e050f46f016b5460b28895467c063680953 (diff)
- Narrow the set of allowed usernames to prevent people from messing with it.4.1.0
-rw-r--r--modules/user.module3
1 files changed, 1 insertions, 2 deletions
diff --git a/modules/user.module b/modules/user.module
index 3182b7d..af845e0 100644
--- a/modules/user.module
+++ b/modules/user.module
@@ -174,9 +174,8 @@ function user_validate_name($name) {
if (ereg("^ ", $name)) return t("The username cannot begin with a space.");
if (ereg(" \$", $name)) return t("The username cannot end with a space.");
if (ereg(" ", $name)) return t("The username cannot contain multiple spaces in a row.");
- // if (ereg("[^a-zA-Z0-9@-@]", $name)) return t("The username contains an illegal character.");
+ if (ereg("[^ a-zA-Z0-9@-@]", $name)) return t("The username contains an illegal character.");
if (ereg('@', $name) && !eregi('@([0-9a-z](-?[0-9a-z])*\.)+[a-z]{2}([zmuvtg]|fo|me)?$', $name)) return t("The username is not a valid authentication ID.");
- if (!eregi('^[[:print:]]+', $name)) return t("The name contains an illegal character.");
if (strlen($name) > 56) return t("The username '$name' is too long: it must be less than 56 characters.");
}