diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-02-24 09:48:43 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-02-24 09:48:43 +0000 |
commit | 9def8135c34d06a01839e1cfbbe970438c76ddce (patch) | |
tree | 9e5c044679cb3cd993466cf00ba9c62c97e91529 /src/plugins/lua/dmarc.lua | |
parent | 9e80349be44b4ceb52702d7f9ff88da7a80a3f9b (diff) | |
download | rspamd-9def8135c34d06a01839e1cfbbe970438c76ddce.tar.gz rspamd-9def8135c34d06a01839e1cfbbe970438c76ddce.zip |
[Minor] Explicitly convert things to strings
Issue: #3272
Diffstat (limited to 'src/plugins/lua/dmarc.lua')
-rw-r--r-- | src/plugins/lua/dmarc.lua | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/plugins/lua/dmarc.lua b/src/plugins/lua/dmarc.lua index ea5407fc3..4a68026c2 100644 --- a/src/plugins/lua/dmarc.lua +++ b/src/plugins/lua/dmarc.lua @@ -127,8 +127,18 @@ end local xml_grammar = gen_xml_grammar() -local function escape_xml(goo) - return xml_grammar:match(goo) +local function escape_xml(input) + if type(input) == 'string' or type(input) == 'userdata' then + return xml_grammar:match(input) + else + input = tostring(input) + + if input then + return xml_grammar:match(input) + end + end + + return '' end -- Default port for redis upstreams |