Changeset

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 1235:9277e0a3922f
children 1237:c669cb78b293
files mod_register_web/mod_register_web.lua
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
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