瀏覽代碼

[Enhancement] Exclude false positives of MIME_DOUBLE_BAD_EXTENSION

If we detected extension of the file and this extension is equal to the real extension then we should not pass second extension to check function as it will trigger false positive for MIME_DOUBLE_BAD_EXTENSION.
pull/4920/head
Dmitriy Alekseev 1 月之前
父節點
當前提交
7d14e4af43
No account linked to committer's email address
共有 1 個文件被更改,包括 6 次插入1 次删除
  1. 6
    1
      src/plugins/lua/mime_types.lua

+ 6
- 1
src/plugins/lua/mime_types.lua 查看文件

@@ -397,7 +397,12 @@ local function check_mime_type(task)
if ext2 then
local score1 = check_tables(ext)
local score2 = check_tables(ext2)
check_extension(score1, score2)
-- Check if detected extension match real extension
if detected_ext and detected_ext == ext then
check_extension(score1, nil)
else
check_extension(score1, score2)
end
-- Check for archive cloaking like .zip.gz
if settings['archive_extensions'][ext2]
-- Exclude multipart archive extensions, e.g. .zip.001

Loading…
取消
儲存