Mercurial > prosody-modules
diff mod_register_web/mod_register_web.lua @ 1236:59332e0bfbdc
mod_register_web: Check for empty username
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 30 Nov 2013 23:36:41 +0100 |
parents | 9277e0a3922f |
children | c669cb78b293 |
line wrap: on
line diff
--- a/mod_register_web/mod_register_web.lua Sat Nov 30 22:59:27 2013 +0100 +++ b/mod_register_web/mod_register_web.lua Sat Nov 30 23:36:41 2013 +0100 @@ -111,6 +111,9 @@ if not prepped_username then return nil, "Username contains forbidden characters"; end + if #prepped_username == 0 then + return nil, "The username field was empty"; + end if usermanager.user_exists(prepped_username, module.host) then return nil, "Username already taken"; end