diff options
author | Kim Alvefur <zash@zash.se> | 2018-04-09 22:05:49 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2018-04-09 22:05:49 +0200 |
commit | 34a61dd7c69289b4e41c3195bc2409a24cfe4ae9 (patch) | |
tree | 6e19259985b068c6998659332b60292afb27f386 | |
parent | b60e8fbee28305368b8cf004bc045d18e4913dee (diff) | |
download | prosody-34a61dd7c69289b4e41c3195bc2409a24cfe4ae9.tar.gz prosody-34a61dd7c69289b4e41c3195bc2409a24cfe4ae9.zip |
mod_register_ibr: Return a textual error to the user for problems with parsing form data
-rw-r--r-- | plugins/mod_register_ibr.lua | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/plugins/mod_register_ibr.lua b/plugins/mod_register_ibr.lua index af10970e..dc7168b4 100644 --- a/plugins/mod_register_ibr.lua +++ b/plugins/mod_register_ibr.lua @@ -140,10 +140,12 @@ module:hook("stanza/iq/jabber:iq:register:query", function(event) local data, errors = parse_response(query); if errors then log("debug", "Error parsing registration form:"); + local textual_errors = {}; for field, err in pairs(errors) do log("debug", "Field %q: %s", field, err); + table.insert(textual_errors, ("%s: %s"):format(field:gsub("^%a", string.upper), err)); end - session.send(st.error_reply(stanza, "modify", "not-acceptable")); + session.send(st.error_reply(stanza, "modify", "not-acceptable", table.concat(textual_errors, "\n"))); return true; end |