Add case insensitive check to username validation

This commit is contained in:
Joey Yakimowich-Payne 2018-08-16 11:10:49 +09:00
commit 7321ee6f61

View file

@ -608,7 +608,7 @@ proc executeRegister(c: TForumData, name, pass, antibot, userIp,
raise newForumError("Invalid username", @["username"])
if getValue(
db,
sql"select name from person where name = ? and isDeleted = 0",
sql"select name from person where name = ? collate nocase and isDeleted = 0",
name
).len > 0:
raise newForumError("Username already exists", @["username"])