Skip to content

Commit

Permalink
[Minor] Explicitly convert things to strings
Browse files Browse the repository at this point in the history
Issue: #3272
  • Loading branch information
vstakhov committed Feb 24, 2020
1 parent 9e80349 commit 9def813
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/plugins/lua/dmarc.lua
Expand Up @@ -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
Expand Down

0 comments on commit 9def813

Please sign in to comment.