]> source.dussan.org Git - rspamd.git/commitdiff
[Rules] Improve zero font rule
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 7 Sep 2021 14:00:58 +0000 (15:00 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 7 Sep 2021 14:01:30 +0000 (15:01 +0100)
rules/html.lua

index 58fabfd7aef4e180701e1f4511acbe182e306488..6427a325ab2f557ce1bb4c512762a53abf9edfce 100644 (file)
@@ -198,11 +198,11 @@ local vis_check_id = rspamd_config:register_symbol{
         hc:foreach_tag({'font', 'span', 'div', 'p', 'td'}, function(tag, clen, is_leaf)
           local bl = tag:get_style()
           if bl then
-            if not bl.visible and is_leaf then
+            if not bl.visible and clen > 0 and is_leaf then
               invisible_blocks = invisible_blocks + 1
             end
 
-            if (bl.font_size or 12) == 0 and is_leaf then
+            if (bl.font_size or 12) == 0 and clen > 0 and is_leaf then
               zero_size_blocks = zero_size_blocks + 1
             end