# HG changeset patch # User Kim Alvefur # Date 1468015002 -7200 # Node ID dc4e7782431850a4fe0a32ebadf3f4087314a6af # Parent 7c90e8a67a4ffdc1487efc4dfe5fa7be88afbce1 mod_invite: Use XML/HTML entity escaping from util.stanza diff -r 7c90e8a67a4f -r dc4e77824318 mod_invite/mod_invite.lua --- a/mod_invite/mod_invite.lua Fri Jul 08 23:42:30 2016 +0200 +++ b/mod_invite/mod_invite.lua Fri Jul 08 23:56:42 2016 +0200 @@ -6,6 +6,7 @@ local http_urlencode = require "net.http".urlencode; local usermanager = require "core.usermanager"; local rostermanager = require "core.rostermanager"; +local tohtml = require "util.stanza".xml_escape local nodeprep = require "util.encodings".stringprep.nodeprep; local tostring = tostring; @@ -16,15 +17,6 @@ module:depends"http"; -local entities = { - ["<"] = "<", [">"] = ">", ["&"] = "&", - ["'"] = "'", ["\""] = """, ["\n"] = "
", -}; - -local function tohtml(plain) - return (plain:gsub("[<>&'\"\n]", entities)); -end - local function apply_template(template, args) return template:gsub("{{([^}]*)}}", function (k)