aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2017-01-06 13:09:09 +0100
committerKim Alvefur <zash@zash.se>2017-01-06 13:09:09 +0100
commitc29639e0db4b023bbebe3d6e134c52761a74d1a1 (patch)
tree23f2c677ee8d6945dac72342adabd7c31e08f814
parent56f3c13d17b6e98923bc914cc51ed95527ea0b55 (diff)
downloadprosody-c29639e0db4b023bbebe3d6e134c52761a74d1a1.tar.gz
prosody-c29639e0db4b023bbebe3d6e134c52761a74d1a1.zip
mod_register: Verify that fields are known to prevent traceback
-rw-r--r--plugins/mod_register.lua3
1 files changed, 3 insertions, 0 deletions
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());