# HG changeset patch # User Waqas Hussain # Date 1263214348 -18000 # Node ID 8ee7ec6fc5fc1887cb4641482b42e2cc2b2e59e5 # Parent 1df57426263aa6bbee2006bb53de33b7ec5ccea7 mod_register: Return a error on empty usernames (thanks Neustradamus). diff -r 1df57426263a -r 8ee7ec6fc5fc plugins/mod_register.lua --- a/plugins/mod_register.lua Sun Jan 10 20:21:48 2010 +0000 +++ b/plugins/mod_register.lua Mon Jan 11 17:52:28 2010 +0500 @@ -141,7 +141,7 @@ 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."));