From 2ed1aa136fd36e7975ea151ee9e3affbcaa5cf59 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Sun, 9 Apr 2017 11:06:26 +0100 Subject: [PATCH] [WebUI] Do not hide messages with bad subject, just replace it with '???' --- src/plugins/lua/history_redis.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/plugins/lua/history_redis.lua b/src/plugins/lua/history_redis.lua index 1564f467c..8a1968542 100644 --- a/src/plugins/lua/history_redis.lua +++ b/src/plugins/lua/history_redis.lua @@ -164,8 +164,7 @@ local function handle_history_request(task, conn, from, to, reset) data = fun.totable( fun.map(function (_, obj) return obj end, fun.filter(function(res, obj) - if res and (not obj.subject or - rspamd_util.is_valid_utf8(obj.subject)) then + if res then return true end return false @@ -180,6 +179,11 @@ local function handle_history_request(task, conn, from, to, reset) return false, nil end end, data)))) + fun.each(function(e) + if e.subject and not rspamd_util.is_valid_utf8(e.subject) then + e.subject = '???' + end + end, data) reply.rows = data conn:send_ucl(reply) else -- 2.39.5