diff options
author | Matthew Wild <mwild1@gmail.com> | 2009-10-06 18:05:31 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2009-10-06 18:05:31 +0100 |
commit | 7b3fe9ce142053c2159fb1479343d7815bbb4f2f (patch) | |
tree | a300c51e14aa412b5e6e821118ed8694b30576be /util | |
parent | 33f79565005842b5b41c19a7fb9740ddd1d67125 (diff) | |
download | prosody-7b3fe9ce142053c2159fb1479343d7815bbb4f2f.tar.gz prosody-7b3fe9ce142053c2159fb1479343d7815bbb4f2f.zip |
util.stanza: Make xml_escape publicly accessible
Diffstat (limited to 'util')
-rw-r--r-- | util/stanza.lua | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/util/stanza.lua b/util/stanza.lua index 3bf7ea58..7b04c508 100644 --- a/util/stanza.lua +++ b/util/stanza.lua @@ -118,10 +118,13 @@ function stanza_mt:childtags() end -local xml_escape = (function() +local xml_escape +do local escape_table = { ["'"] = "'", ["\""] = """, ["<"] = "<", [">"] = ">", ["&"] = "&" }; - return function(str) return (s_gsub(str, "['&<>\"]", escape_table)); end -end)(); + function xml_escape(str) return (s_gsub(str, "['&<>\"]", escape_table)); end + _M.xml_escape = xml_escape; +end + local function _dostring(t, buf, self, xml_escape) local nsid = 0; local name = t.name |