]> source.dussan.org Git - rspamd.git/commitdiff
[WebUI] Do not hide messages with bad subject, just replace it with '???'
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 9 Apr 2017 10:06:26 +0000 (11:06 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 9 Apr 2017 10:06:26 +0000 (11:06 +0100)
src/plugins/lua/history_redis.lua

index 1564f467c2d9c9e96c567a24d281b49e40f278bc..8a196854242ddfd99874bc508a18f880ede4257e 100644 (file)
@@ -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