aboutsummaryrefslogtreecommitdiffstats
path: root/lualib/lua_scanners/init.lua
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-12-29 10:40:01 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-12-29 10:40:01 +0000
commit2f2526e7005bc151a032dacec6a182107dde5a74 (patch)
tree0f0b07fb1a75796d163a8a7d7c5302ac3e11d268 /lualib/lua_scanners/init.lua
parentf9d5c7051dba5f9acd97f160ea07981a264d64bf (diff)
downloadrspamd-2f2526e7005bc151a032dacec6a182107dde5a74.tar.gz
rspamd-2f2526e7005bc151a032dacec6a182107dde5a74.zip
[Minor] Lua_scanner: allow to have multiple types in scanners
Diffstat (limited to 'lualib/lua_scanners/init.lua')
-rw-r--r--lualib/lua_scanners/init.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/lualib/lua_scanners/init.lua b/lualib/lua_scanners/init.lua
index 149402874..e91feecfd 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