Skip to content
Snippets Groups Projects
Commit d50941ce authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- Narrow the set of allowed usernames to prevent people from messing with it.
parent d7b29e05
No related branches found
No related tags found
No related merge requests found
...@@ -174,9 +174,8 @@ function user_validate_name($name) { ...@@ -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 begin with a space.");
if (ereg(" \$", $name)) return t("The username cannot end 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(" ", $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 (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."); if (strlen($name) > 56) return t("The username '$name' is too long: it must be less than 56 characters.");
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment