From: Vsevolod Stakhov Date: Mon, 8 Mar 2021 00:56:03 +0000 (-0500) Subject: [Minor] Fix plain Lua compatibility X-Git-Tag: 3.0~605 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7677fcfec0c89f0068e795f333d6f0de9103f275;p=thirdparty%2Frspamd.git [Minor] Fix plain Lua compatibility --- diff --git a/lualib/lua_fuzzy.lua b/lualib/lua_fuzzy.lua index 683c573728..8547a5dbc6 100644 --- a/lualib/lua_fuzzy.lua +++ b/lualib/lua_fuzzy.lua @@ -245,8 +245,15 @@ local function mime_types_check(task, part, rule) if not t then return false, false end local ct = string.format('%s/%s', t, st) + + local detected_ct t,st = part:get_detected_type() - local detected_ct = string.format('%s/%s', t, st) + if t then + detected_ct = string.format('%s/%s', t, st) + else + detected_ct = ct + end + local id = part:get_id() lua_util.debugm(N, task, 'check binary part %s: %s', id, ct)