- Narrow the set of allowed usernames to prevent people from messing with it.

4.2.x
Dries Buytaert 2003-06-25 15:46:03 +00:00
parent 1f91ef891e
commit 2689d6aa1e
2 changed files with 2 additions and 4 deletions

View File

@ -175,9 +175,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.", array("%name" => $name));
}

View File

@ -175,9 +175,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.", array("%name" => $name));
}