From f22fd35fc8650db2db4a75400184130ec2beae49 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 20 Nov 2020 11:23:04 +0000 Subject: [PATCH] [Minor] Lua_magic: Do not treat by default non-text part as text --- lualib/lua_magic/heuristics.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lualib/lua_magic/heuristics.lua b/lualib/lua_magic/heuristics.lua index 02bc2b4a2..a0efdf50f 100644 --- a/lualib/lua_magic/heuristics.lua +++ b/lualib/lua_magic/heuristics.lua @@ -446,6 +446,11 @@ exports.text_part_heuristic = function(part, log_obj, _) return 'html',21 end + if mtype ~= 'text' then + -- Do not treat non text patterns as text + return nil + end + return 'txt',40 end end -- 2.39.5