From 0e67359b5c5444db608af5d07821811e08c4f95f Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Mon, 11 Jan 2010 17:52:28 +0500 Subject: mod_register: Return a error on empty usernames (thanks Neustradamus). --- plugins/mod_register.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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.")); -- cgit v1.2.3