aboutsummaryrefslogtreecommitdiffstats
path: root/lualib/lua_fuzzy.lua
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2021-03-22 15:17:18 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2021-03-22 15:17:18 +0000
commitea11c0e7b1eb27f345680e8b6399a45dea5c4dd7 (patch)
tree2d8544e89109e18de19d98876b3a08051f2f319c /lualib/lua_fuzzy.lua
parenta4238dce6f6315bde0c75c853c14e9e241445ef4 (diff)
downloadrspamd-ea11c0e7b1eb27f345680e8b6399a45dea5c4dd7.tar.gz
rspamd-ea11c0e7b1eb27f345680e8b6399a45dea5c4dd7.zip
[Fix] Lua_fuzzy: Remove text parts check when checking image dimensions
Diffstat (limited to 'lualib/lua_fuzzy.lua')
-rw-r--r--lualib/lua_fuzzy.lua25
1 files changed, 7 insertions, 18 deletions
diff --git a/lualib/lua_fuzzy.lua b/lualib/lua_fuzzy.lua
index 8547a5dbc..45227330f 100644
--- a/lualib/lua_fuzzy.lua
+++ b/lualib/lua_fuzzy.lua
@@ -192,11 +192,10 @@ local function check_text_part(task, part, rule, text)
return allow_direct,allow_shingles
end
-local function has_sane_text_parts(task)
- local text_parts = task:get_text_parts() or {}
-
- return fun.any(function(tp) return tp:get_words_count() > 32 end, text_parts)
-end
+--local function has_sane_text_parts(task)
+-- local text_parts = task:get_text_parts() or {}
+-- return fun.any(function(tp) return tp:get_words_count() > 32 end, text_parts)
+--end
local function check_image_part(task, part, rule, image)
if rule.skip_images then
@@ -216,19 +215,9 @@ local function check_image_part(task, part, rule, image)
if height and width then
if height < min_height or width < min_width then
-
-
- if not has_sane_text_parts(task) then
- lua_util.debugm(N, task, 'allow image part %s (%sx%s): no large enough text part found',
- id, width, height)
- return true, false
- else
- lua_util.debugm(N, task, 'skip image part %s as it does not meet minimum sizes: %sx%s < %sx%s',
- id, width, height, min_width, min_height)
- return false, false
- end
-
-
+ lua_util.debugm(N, task, 'skip image part %s as it does not meet minimum sizes: %sx%s < %sx%s',
+ id, width, height, min_width, min_height)
+ return false, false
else
lua_util.debugm(N, task, 'allow image part %s: %sx%s',
id, width, height)