From: Vsevolod Stakhov Date: Thu, 14 May 2020 11:43:32 +0000 (+0100) Subject: [Fix] Fix passing of methods arguments X-Git-Tag: 2.6~425 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=fbaa06d71d3421aad83a61c74fb45b9ee996b883;p=rspamd.git [Fix] Fix passing of methods arguments --- diff --git a/lualib/lua_selectors/init.lua b/lualib/lua_selectors/init.lua index ba20810c5..8de79f767 100644 --- a/lualib/lua_selectors/init.lua +++ b/lualib/lua_selectors/init.lua @@ -102,7 +102,7 @@ local function process_selector(task, sel) if meth.types[etype] then lua_util.debugm(M, task, 'apply method `%s` to %s', meth.name, etype) - input,etype = meth.process(input, etype) + input,etype = meth.process(input, etype, meth.args) else local pt = pure_type(etype) @@ -342,7 +342,7 @@ exports.parse_selector = function(cfg, str) return inp[method_name],'string' else -- We call method unpacking arguments and dropping all but the first result returned - local ret = (inp[method_name](inp, unpack_function(args))) + local ret = (inp[method_name](inp, unpack_function(args or E))) local ret_type = type(ret) -- Now apply types heuristic if ret_type == 'string' then