mirror of
https://codeberg.org/metamuffin/abrechenbarkeit.git
synced 2024-12-29 00:04:35 +00:00
invalidate usernames comprised entirely of whitespace
This commit is contained in:
parent
2b5aa684f1
commit
373242c40a
1 changed files with 2 additions and 1 deletions
|
@ -427,7 +427,8 @@ end
|
|||
|
||||
local function r_create_user()
|
||||
local username = query.create_user
|
||||
if username:match("^([%w_ -]+)$") == nil then
|
||||
-- gsub to remove whitespace. disallows username made up entirely of whitespace
|
||||
if username:gsub("%s+", ""):match("^([%w_ -]+)$") == nil then
|
||||
return respond_error("invalid username " .. username)
|
||||
end
|
||||
return redirect(string.format("/%s", urlencode(username)))
|
||||
|
|
Loading…
Reference in a new issue