]> source.dussan.org Git - rspamd.git/commitdiff
[Rules] Improve URL_COUNT_ODD rule
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 6 Jun 2017 12:53:56 +0000 (13:53 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 6 Jun 2017 12:53:56 +0000 (13:53 +0100)
rules/misc.lua

index 2a4b5c107b0247e777a3ef150d7accd11e9e6f76..35942e3e1641e8e15fdf5e3e587e5804515faa3a 100644 (file)
@@ -288,7 +288,7 @@ rspamd_config.URI_COUNT_ODD = {
       local urls = task:get_urls() or {}
       local nurls = fun.filter(function(url)
         return not url:is_html_displayed()
-      end, urls):foldl(function(acc, val) return acc + 1 end, 0)
+      end, urls):foldl(function(acc, val) return acc + val:get_count() end, 0)
 
       if nurls % 2 == 1 then
         return true, 1.0, tostring(nurls)