From cd8ff4a0bf097e3a65452a2222456e782bb29686 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Fri, 6 Jan 2017 13:09:09 +0100 Subject: mod_register: Verify that fields are known to prevent traceback --- plugins/mod_register.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/mod_register.lua b/plugins/mod_register.lua index 7a57d65b..9358eb64 100644 --- a/plugins/mod_register.lua +++ b/plugins/mod_register.lua @@ -63,6 +63,7 @@ for _, field in ipairs(additional_fields) do if type(field) == "table" then registration_form[#registration_form + 1] = field; else + elseif field_map[field] or field_map[field:sub(1, -2) then if field:match("%+$") then field = field:sub(1, -2); field_map[field].required = true; @@ -70,6 +71,8 @@ for _, field in ipairs(additional_fields) do registration_form[#registration_form + 1] = field_map[field]; registration_query:tag(field):up(); + else + module:log("error", "Unknown field %q", field); end end registration_query:add_child(registration_form:form()); -- cgit v1.2.3