# HG changeset patch # User Thilo Cestonaro # Date 1268299107 -3600 # Node ID 445efff314c4b8ffc6b57e663751444d7b244ca8 # Parent f37de7e2ad1454afe14fb1ef21a816480352b423 mod_muc_log_http: handle empty status message tags; handle a nil-parameter in htmlEscape diff -r f37de7e2ad14 -r 445efff314c4 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 Sat Mar 06 22:32:12 2010 +0500 +++ b/mod_muc_log_http/muc_log_http/mod_muc_log_http.lua Thu Mar 11 10:18:27 2010 +0100 @@ -81,14 +81,18 @@ end local function htmlEscape(t) - t = t:gsub("<", "<"); - t = t:gsub(">", ">"); - t = t:gsub("(http://[%a%d@%.:/&%?=%-_#%%~]+)", function(h) - h = urlunescape(h) - return "" .. h .. ""; - end); - t = t:gsub("\n", "
"); - t = t:gsub("%%", "%%%%"); + if t then + t = t:gsub("<", "<"); + t = t:gsub(">", ">"); + t = t:gsub("(http://[%a%d@%.:/&%?=%-_#%%~]+)", function(h) + h = urlunescape(h) + return "" .. h .. ""; + end); + t = t:gsub("\n", "
"); + t = t:gsub("%%", "%%%%"); + else + t = ""; + end return t; end @@ -375,7 +379,7 @@ alreadyJoined = true; elseif tag.tag == "show" then show = tag[1]; - elseif tag.tag == "status" then + elseif tag.tag == "status" and tag[1] ~= nil then status = tag[1]; end end