mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
Accept upper case letters in valid_username()
In commit 0722f46
(Simplify valid_user() and valid_username(),
2014-02-06), the conversion to lower case letters was unintentionally
removed and in consequence, names with upper case letters have been
rejected since then.
Instead of reintroducing the conversion, add the "i" modifier to the
regular expression validating the name to do case-insensitive pattern
matching.
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
This commit is contained in:
parent
4cd6841541
commit
e018670607
1 changed files with 1 additions and 1 deletions
|
@ -538,7 +538,7 @@ function valid_username($user) {
|
|||
if (strlen($user) < USERNAME_MIN_LEN ||
|
||||
strlen($user) > USERNAME_MAX_LEN) {
|
||||
return false;
|
||||
} else if (!preg_match("/^[a-z0-9]+[.\-_]?[a-z0-9]+$/", $user)) {
|
||||
} else if (!preg_match("/^[a-z0-9]+[.\-_]?[a-z0-9]+$/i", $user)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue