From: Vsevolod Stakhov Date: Sat, 29 Dec 2018 10:40:01 +0000 (+0000) Subject: [Minor] Lua_scanner: allow to have multiple types in scanners X-Git-Tag: 1.9.0~367 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2f2526e7005bc151a032dacec6a182107dde5a74;p=thirdparty%2Frspamd.git [Minor] Lua_scanner: allow to have multiple types in scanners --- diff --git a/lualib/lua_scanners/init.lua b/lualib/lua_scanners/init.lua index 149402874e..e91feecfdc 100644 --- a/lualib/lua_scanners/init.lua +++ b/lualib/lua_scanners/init.lua @@ -48,7 +48,10 @@ end exports.filter = function(t) return fun.tomap(fun.filter(function(_, elt) - return type(elt) == 'table' and elt.type and elt.type == t + return type(elt) == 'table' and elt.type and ( + (type(elt.type) == 'string' and elt.type == t) or + (type(elt.type) == 'table' and fun.any(function(tt) return tt == t end, elt.type)) + ) end, exports)) end