commit ea11c0e: [Fix] Lua_fuzzy: Remove text parts check when checking image dimensions

Vsevolod Stakhov vsevolod at highsecure.ru
Mon Mar 22 15:21:05 UTC 2021


Author: Vsevolod Stakhov
Date: 2021-03-22 15:17:18 +0000
URL: https://github.com/rspamd/rspamd/commit/ea11c0e7b1eb27f345680e8b6399a45dea5c4dd7 (HEAD -> master)

[Fix] Lua_fuzzy: Remove text parts check when checking image dimensions

---
 lualib/lua_fuzzy.lua | 25 +++++++------------------
 1 file 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)


More information about the Commits mailing list