From: Vsevolod Stakhov Date: Sun, 9 Apr 2017 10:06:26 +0000 (+0100) Subject: [WebUI] Do not hide messages with bad subject, just replace it with '???' X-Git-Tag: 1.5.5~1 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=2ed1aa136fd36e7975ea151ee9e3affbcaa5cf59;p=rspamd.git [WebUI] Do not hide messages with bad subject, just replace it with '???' --- 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