diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-05-26 16:55:34 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-05-26 16:55:34 +0100 |
commit | a595f00595b1c2ad1e4244d0da02cae14bc7279b (patch) | |
tree | 64fb62a0fe93079ccbbed5244847b780066e2741 /src | |
parent | 642a7f9a075c5f683d5b62c729317c30b2f5fc83 (diff) | |
download | rspamd-a595f00595b1c2ad1e4244d0da02cae14bc7279b.tar.gz rspamd-a595f00595b1c2ad1e4244d0da02cae14bc7279b.zip |
[Minor] Mime_types: Fix FP with double dots
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/lua/mime_types.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/lua/mime_types.lua b/src/plugins/lua/mime_types.lua index 24b88da1d..1760f3cb5 100644 --- a/src/plugins/lua/mime_types.lua +++ b/src/plugins/lua/mime_types.lua @@ -257,7 +257,7 @@ local function check_mime_type(task) if #parts > 2 then -- We need to ensure that next-to-last extension is an extension, -- so we check for its length and if it is not a number or date - if #ext2 <= 4 and not string.match(ext2, '^%d+[%]%)]?$') then + if #ext2 > 0 and #ext2 <= 4 and not string.match(ext2, '^%d+[%]%)]?$') then -- Use the greatest badness multiplier if not badness_mult or @@ -457,7 +457,7 @@ local function check_mime_type(task) -- the same as double extension of the file local _,ext2 = gen_extension(filename) - if ext2 then + if ext2 and #ext2 > 0 then local enc_ext = gen_extension(fl[1].name) if enc_ext |