]> source.dussan.org Git - rspamd.git/commitdiff
Revert "[Fix] Selectors: Filter nil elements in lists"
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 25 Feb 2021 12:36:01 +0000 (12:36 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 25 Feb 2021 12:36:01 +0000 (12:36 +0000)
This reverts commit 60396f2478b0f7284b42139d6d8e05bf81b12b20.

lualib/lua_selectors/init.lua

index 9a4af2e046c9a6664923bae5a1b08ac7d25dc1b0..cc44d0b017d4ac7dc3602ee9f86fffba29faf455 100644 (file)
@@ -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