Просмотр исходного кода

[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 месяц назад
Родитель
Сommit
7d14e4af43
Аккаунт пользователя с таким Email не найден
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

Загрузка…
Отмена
Сохранить