diff options
author | Waqas Hussain <waqas20@gmail.com> | 2010-01-11 17:52:28 +0500 |
---|---|---|
committer | Waqas Hussain <waqas20@gmail.com> | 2010-01-11 17:52:28 +0500 |
commit | 52cfde2f6e1d568a2e6a9ba8ce61299f2ed6c2eb (patch) | |
tree | 338ace2200af4985fdc826f48e5018afc38a91bb | |
parent | ccf63862c565d1dcbea9ca3fdb2237b1800aa2dd (diff) | |
download | prosody-52cfde2f6e1d568a2e6a9ba8ce61299f2ed6c2eb.tar.gz prosody-52cfde2f6e1d568a2e6a9ba8ce61299f2ed6c2eb.zip |
mod_register: Return a <not-acceptable/> error on empty usernames (thanks Neustradamus).
-rw-r--r-- | plugins/mod_register.lua | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/mod_register.lua b/plugins/mod_register.lua index bda40124..be1be0ae 100644 --- a/plugins/mod_register.lua +++ b/plugins/mod_register.lua @@ -141,7 +141,7 @@ module:add_iq_handler("c2s_unauthed", "jabber:iq:register", function (session, s username = nodeprep(table.concat(username)); password = table.concat(password); local host = module.host; - if not username then + if not username or username == "" then session.send(st.error_reply(stanza, "modify", "not-acceptable", "The requested username is invalid.")); elseif usermanager_user_exists(username, host) then session.send(st.error_reply(stanza, "cancel", "conflict", "The requested username already exists.")); |