]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Mime_types: Add exclusion for numbers in extensions
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 27 Dec 2018 14:46:37 +0000 (14:46 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 27 Dec 2018 14:46:37 +0000 (14:46 +0000)
src/plugins/lua/mime_types.lua

index e52933af12aa5fab0185b64b44e520421c1777f8..e13d535b4aba9a99de002626a73e9ba31d33d6ec 100644 (file)
@@ -1001,7 +1001,9 @@ local function check_mime_type(task)
               if ext2 then
                 local enc_ext = gen_extension(fl[1].name)
 
-                if enc_ext and enc_ext ~= ext2 then
+                if enc_ext and
+                    not string.match(ext2, '^%d+$')
+                    and enc_ext ~= ext2 then
                   task:insert_result(settings['symbol_double_extension'], 2.0,
                       string.format("%s!=%s", ext2, enc_ext))
                 end