]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Lua_magic: Some minor fixes
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 9 Sep 2019 14:08:05 +0000 (15:08 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 9 Sep 2019 14:08:05 +0000 (15:08 +0100)
lualib/lua_magic/init.lua
lualib/lua_magic/patterns.lua

index 27f968149338746a490c59dfcdfe154668118b3c..0784b4a77b3fbf23b8a22c6b926de6d139f46812 100644 (file)
@@ -326,9 +326,9 @@ exports.detect_mime_part = function(part, log_obj)
     return ext,types[ext]
   end
 
-  ext,weight = exports.detect(part:get_content(), log_obj)
+  ext = exports.detect(part:get_content(), log_obj)
 
-  if ext and weight and weight > 20 then
+  if ext then
     return ext,types[ext]
   end
 
index 630f287cefac9280aff11bf81cbfa54d8961e4dd..1ac18c8ea002f09b616f7403ddeb6f9ac6ab1dd7 100644 (file)
@@ -209,8 +209,8 @@ local patterns = {
   zst = {
     matches = {
       {
-        string = [[\x{FD}\x{2F}\x{B5}[\x{22}-\x{40}].]],
-        position = 5, -- includes last .
+        string = [[[\x{22}-\x{40}]\x{B5}\x{2F}\x{FD}]],
+        position = 4,
         weight = 60,
       },
     }