]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Fix] Lua_fuzzy: Remove text parts check when checking image dimensions
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 22 Mar 2021 15:17:18 +0000 (15:17 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 22 Mar 2021 15:17:18 +0000 (15:17 +0000)
lualib/lua_fuzzy.lua

index 8547a5dbc6a1428bfe0494c1edd411d45d0a93fe..45227330f026e5485d6456a3c016fe1698c45f2e 100644 (file)
@@ -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)