diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-02-25 12:36:01 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-02-25 12:36:01 +0000 |
commit | 8fe0974de537d25bf60637c9ff2d6463eca660b4 (patch) | |
tree | 0087941707fce781f6149d4a2d480f9b97dd3a81 /lualib/lua_selectors/init.lua | |
parent | 60396f2478b0f7284b42139d6d8e05bf81b12b20 (diff) | |
download | rspamd-8fe0974de537d25bf60637c9ff2d6463eca660b4.tar.gz rspamd-8fe0974de537d25bf60637c9ff2d6463eca660b4.zip |
Revert "[Fix] Selectors: Filter nil elements in lists"
This reverts commit 60396f2478b0f7284b42139d6d8e05bf81b12b20.
Diffstat (limited to 'lualib/lua_selectors/init.lua')
-rw-r--r-- | lualib/lua_selectors/init.lua | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/lualib/lua_selectors/init.lua b/lualib/lua_selectors/init.lua index 9a4af2e04..cc44d0b01 100644 --- a/lualib/lua_selectors/init.lua +++ b/lualib/lua_selectors/init.lua @@ -349,18 +349,13 @@ exports.parse_selector = function(cfg, str) ret = (inp[method_name](inp, unpack_function(args or E))) end - -- Do not go further - if not ret then return nil end - local ret_type = type(ret) -- Now apply types heuristic if ret_type == 'string' then return ret,'string' - elseif ret_type == 'table' and ret[1] ~= nil then - local filt_predicate = fun.filter(function(elt) - return elt ~= nil - end, ret) - return filt_predicate, 'string_list' + elseif ret_type == 'table' then + -- TODO: we need to ensure that 1) table is numeric 2) table has merely strings + return ret,'string_list' else return implicit_tostring(ret_type, ret) end |