]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Make extension checks case-insensitive 738/head
authorAlexander Moisseev <moiseev@mezonplus.ru>
Thu, 21 Jul 2016 15:11:19 +0000 (19:11 +0400)
committerAlexander Moisseev <moiseev@mezonplus.ru>
Thu, 21 Jul 2016 15:11:19 +0000 (19:11 +0400)
src/plugins/lua/mime_types.lua

index d598f2e8a122d38ca955b7b8a5f293484d7a9790..1395149b6dc7038abdfadca5ca776512827c77d0 100644 (file)
@@ -101,19 +101,19 @@ local function check_mime_type(task)
     end
 
     if ext then
-      check_extension(settings['bad_extensions'][ext])
+      check_extension(settings['bad_extensions'][ext:lower()])
 
       -- Also check for archive bad extension
       if is_archive then
-        check_extension(settings['bad_archive_extensions'][ext])
+        check_extension(settings['bad_archive_extensions'][ext:lower()])
 
-        if settings['archive_extensions'][ext] then
+        if settings['archive_extensions'][ext:lower()] then
           -- Archive in archive
           task:insert_result(settings['symbol_archive_in_archive'], 1.0, ext)
         end
       end
 
-      local mt = settings['extension_map'][ext]
+      local mt = settings['extension_map'][ext:lower()]
       if mt and ct then
         local found = nil
         if (type(mt) == "table") then