commit e6556d5: [Minor] Lua_selectors: Add optional shadow result name

Vsevolod Stakhov vsevolod at highsecure.ru
Thu Apr 23 15:14:07 UTC 2020


Author: Vsevolod Stakhov
Date: 2020-04-23 16:10:48 +0100
URL: https://github.com/rspamd/rspamd/commit/e6556d52c29bc350b20bea5480726eb98c460639

[Minor] Lua_selectors: Add optional shadow result name

---
 lualib/lua_selectors/extractors.lua | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lualib/lua_selectors/extractors.lua b/lualib/lua_selectors/extractors.lua
index c01a07f4b..c40b93b3b 100644
--- a/lualib/lua_selectors/extractors.lua
+++ b/lualib/lua_selectors/extractors.lua
@@ -418,16 +418,18 @@ The first argument must be header name.]],
   -- Get specific symbol
   ['symbol'] = {
     ['get_value'] = function(task, args)
-      local symbol = task:get_symbol(args[1])
+      local symbol = task:get_symbol(args[1], args[2])
       if symbol then
         return symbol[1],'table'
       end
     end,
     ['description'] = 'Get specific symbol. The first argument must be the symbol name. ' ..
+      'The second argument is an optional shadow result name. ' ..
       'Returns the symbol table. See task:get_symbol()',
-    ['args_schema'] = {ts.string}
+    ['args_schema'] = {ts.string, ts.string:is_optional()}
   },
 
+
 }
 
 return extractors


More information about the Commits mailing list