diff options
author | Kim Alvefur <zash@zash.se> | 2017-01-06 13:09:09 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2017-01-06 13:09:09 +0100 |
commit | cd8ff4a0bf097e3a65452a2222456e782bb29686 (patch) | |
tree | 23f2c677ee8d6945dac72342adabd7c31e08f814 | |
parent | 1f2b72e2ca01b540054d5b245bf7d07870d42baf (diff) | |
download | prosody-cd8ff4a0bf097e3a65452a2222456e782bb29686.tar.gz prosody-cd8ff4a0bf097e3a65452a2222456e782bb29686.zip |
mod_register: Verify that fields are known to prevent traceback
-rw-r--r-- | plugins/mod_register.lua | 3 |
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()); |