# HG changeset patch # User Thilo Cestonaro # Date 1255985010 -7200 # Node ID cddcea7c091a2dbdb40699dbd9812d1172275adf # Parent e9de45beaf5e8ffac360c4a7555b602db4b15d75 mod_muc_log: set content-type header; escape some html stuff in messages (>, <, \n, http://....) diff -r e9de45beaf5e -r cddcea7c091a mod_muc_log/mod_muc_log.lua --- a/mod_muc_log/mod_muc_log.lua Mon Oct 19 22:15:57 2009 +0200 +++ b/mod_muc_log/mod_muc_log.lua Mon Oct 19 22:43:30 2009 +0200 @@ -26,6 +26,7 @@ ]]-- local html = {}; html.doc = [[ + muc_log @@ -157,8 +158,11 @@ end local function htmlEscape(t) + t = t:gsub("<", "<"); + t = t:gsub(">", ">"); + t = t:gsub("(http://[%a%d@%.:/&%?=%-_#]+)", [[%1]]); t = t:gsub("\n", "
"); - -- TODO link text into klickable link and such stuff + -- TODO do any html escaping stuff ... return t; end