diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-11-06 20:29:48 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-06 20:29:48 +0000 |
commit | 8f0dae5432a766fbb5b23aa1c7bb09234e89b78d (patch) | |
tree | 185bd1091b00c3b412717d407b2f3afeb8b71dbe | |
parent | ec03ec15402c65ebe69576ef7d6aa3782ab83a2f (diff) | |
parent | 743d314d0b30244df81328c4f5e952ad8b83bd0f (diff) | |
download | rspamd-8f0dae5432a766fbb5b23aa1c7bb09234e89b78d.tar.gz rspamd-8f0dae5432a766fbb5b23aa1c7bb09234e89b78d.zip |
Merge pull request #1906 from moisseev/mime-types
Fixes for mime_types
-rw-r--r-- | src/plugins/lua/mime_types.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/lua/mime_types.lua b/src/plugins/lua/mime_types.lua index 1705ca366..4fa43f09f 100644 --- a/src/plugins/lua/mime_types.lua +++ b/src/plugins/lua/mime_types.lua @@ -106,6 +106,7 @@ local function check_mime_type(task) -- ext2 is the one before last extension LOWERCASED 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 @@ -113,7 +114,7 @@ local function check_mime_type(task) -- Use the greatest badness multiplier if not badness_mult or - (badness_mult2 and #ext2 <= 4 and badness_mult < badness_mult2) then + (badness_mult2 and badness_mult < badness_mult2) then badness_mult = badness_mult2 end |