# HG changeset patch # User Thilo Cestonaro # Date 1263480010 -3600 # Node ID ecf05eb2d83378d0b218e61d9adec85ffab64d47 # Parent f68a781efe81ade17c4d3f63bd8fed7f8dee2a11 mod_muc_log_http: support even more evil url stuff, don't forget %-signs diff -r f68a781efe81 -r ecf05eb2d833 mod_muc_log_http/muc_log_http/mod_muc_log_http.lua --- a/mod_muc_log_http/muc_log_http/mod_muc_log_http.lua Thu Jan 14 12:54:44 2010 +0100 +++ b/mod_muc_log_http/muc_log_http/mod_muc_log_http.lua Thu Jan 14 15:40:10 2010 +0100 @@ -68,6 +68,7 @@ function createDoc(body) if body then + body = body:gsub("%%", "%%%%"); return html.doc:gsub("###BODY_STUFF###", body); end end @@ -82,11 +83,12 @@ local function htmlEscape(t) t = t:gsub("<", "<"); t = t:gsub(">", ">"); - t = t:gsub("(http://[%a%d@%.:/&%?=%-_#%%]+)", function(h) + t = t:gsub("(http://[%a%d@%.:/&%?=%-_#%%~]+)", function(h) h = urlunescape(h) return "" .. h .. ""; end); t = t:gsub("\n", "
"); + t = t:gsub("%%", "%%%%"); return t; end @@ -583,7 +585,7 @@ if previousDay then previousDay = html.day.dayLink:gsub("###DAY###", previousDay):gsub("###TEXT###", "<< previous day"); end - tmp = html.day.body:gsub("###DAY_STUFF###", ret):gsub("###JID###", bareRoomJid); + tmp = html.day.body:gsub("###DAY_STUFF###", ret:gsub("%%", "%%%%")):gsub("###JID###", bareRoomJid); tmp = tmp:gsub("###YEAR###", year):gsub("###MONTH###", month):gsub("###DAY###", day); tmp = tmp:gsub("###TITLE_STUFF###", html.day.title:gsub("###TITLE###", roomSubject)); tmp = tmp:gsub("###STATUS_CHECKED###", config.showStatus and "checked='checked'" or "");