aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2010-01-11 17:52:28 +0500
committerWaqas Hussain <waqas20@gmail.com>2010-01-11 17:52:28 +0500
commit0e67359b5c5444db608af5d07821811e08c4f95f (patch)
treea5226fd07998388dbd51cb3c919fad5599a224e0
parent7a04ee2962ab0b83bc0042da27f1ce62225cf3c4 (diff)
downloadprosody-0e67359b5c5444db608af5d07821811e08c4f95f.tar.gz
prosody-0e67359b5c5444db608af5d07821811e08c4f95f.zip
mod_register: Return a <not-acceptable/> error on empty usernames (thanks Neustradamus).
-rw-r--r--plugins/mod_register.lua2
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."));