aboutsummaryrefslogtreecommitdiffstats
path: root/rules
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2021-09-07 15:00:58 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2021-09-07 15:01:30 +0100
commitd2ca78731396d34148d3b2ab1d0503d07621557b (patch)
treedac46692546cf2f372e85721067d61468eb3aadd /rules
parent909a594f8d003dbe89462ad02d1634371f42bec3 (diff)
downloadrspamd-d2ca78731396d34148d3b2ab1d0503d07621557b.tar.gz
rspamd-d2ca78731396d34148d3b2ab1d0503d07621557b.zip
[Rules] Improve zero font rule
Diffstat (limited to 'rules')
-rw-r--r--rules/html.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/rules/html.lua b/rules/html.lua
index 58fabfd7a..6427a325a 100644
--- a/rules/html.lua
+++ b/rules/html.lua
@@ -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