summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlexander Moisseev <moiseev@mezonplus.ru>2017-12-08 10:57:07 +0300
committerAlexander Moisseev <moiseev@mezonplus.ru>2017-12-08 10:57:07 +0300
commit08461569b4ef12a5651ffb4ef7af064370e6758a (patch)
treea6c597934778237eefc7d00ff45967b5ccb9f171 /src
parent4d9a038f4e3e2253a5e71749980ad12a29eb4cda (diff)
downloadrspamd-08461569b4ef12a5651ffb4ef7af064370e6758a.tar.gz
rspamd-08461569b4ef12a5651ffb4ef7af064370e6758a.zip
[Fix] mime_types: fix next-to-last extension length check
Diffstat (limited to 'src')
-rw-r--r--src/plugins/lua/mime_types.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/lua/mime_types.lua b/src/plugins/lua/mime_types.lua
index 9dee24c6b..0f88e557b 100644
--- a/src/plugins/lua/mime_types.lua
+++ b/src/plugins/lua/mime_types.lua
@@ -110,9 +110,9 @@ local function check_mime_type(task)
local function check_extension(badness_mult, badness_mult2)
if not badness_mult and not badness_mult2 then return end
if #parts > 2 then
- -- We need to ensure that it is an extension, so we check for its length
- -- Check if next-to-last extension is not a number or date
- if #ext <= 4 and ext2 and not string.match(ext2, '^%d+$') 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
-- Use the greatest badness multiplier
if not badness_mult or