summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Fleischer <archlinux@cryptocrack.de>2014-05-30 09:32:48 +0200
committerLukas Fleischer <archlinux@cryptocrack.de>2014-05-30 09:32:48 +0200
commite018670607ce6491163fbefb8eb84eec8588bf7b (patch)
tree31eb1c5c017ee494439e789299740f0cfaf4f383
parent4cd6841541ef6464342ef865366fb88d02a5b51c (diff)
downloadaur-e018670607ce6491163fbefb8eb84eec8588bf7b.tar.gz
aur-e018670607ce6491163fbefb8eb84eec8588bf7b.tar.xz
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>
-rw-r--r--web/lib/acctfuncs.inc.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/web/lib/acctfuncs.inc.php b/web/lib/acctfuncs.inc.php
index 962ebb45..51ffec63 100644
--- a/web/lib/acctfuncs.inc.php
+++ b/web/lib/acctfuncs.inc.php
@@ -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;
}