]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Handle callbacks that returns table of options
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 16 Mar 2018 11:51:46 +0000 (11:51 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 16 Mar 2018 11:51:46 +0000 (11:51 +0000)
lualib/lua_squeeze_rules.lua

index d04352a685353cd8ffbab440b317c4a1cb56b0bc..5db715fb1915f0eca62acc4b7edc397a32277455 100644 (file)
@@ -38,7 +38,12 @@ local function gen_lua_squeeze_function(order)
         if type(first) == 'boolean' then
           if first then
             table.remove(ret, 1)
-            task:insert_result(sym, 1.0, ret)
+
+            if type(ret[1]) == 'table' then
+              task:insert_result(sym, 1.0, ret[1])
+            else
+              task:insert_result(sym, 1.0, ret)
+            end
           end
         elseif type(first) == 'number' then
           table.remove(ret, 1)