return symbol[1],'table'
end
end,
- ['description'] = [[Get specific symbol. The first argument must be the symbol name. Returns the symbol table. See task:get_symbol()]],
+ ['description'] = 'Get specific symbol. The first argument must be the symbol name. ' ..
+ 'Returns the symbol table. See task:get_symbol()',
['args_schema'] = {ts.string}
},
end
end,
['description'] = 'Applies mask to IP address.' ..
- ' The first argument is the mask for IPv4 addresses, the second is the mask for IPv6 addresses.',
+ ' The first argument is the mask for IPv4 addresses, the second is the mask for IPv6 addresses.',
['args_schema'] = {(ts.number + ts.string / tonumber),
(ts.number + ts.string / tonumber):is_optional()}
},
['map_type'] = 'string',
['process'] = function(inp, _, args)
if type(inp) == 'table' then
- return fun.map( function(s) return string.gsub(tostring(s), '[\128-\255]', args[1] or '?') end , inp), 'string_list'
+ return fun.map(
+ function(s)
+ return string.gsub(tostring(s), '[\128-\255]', args[1] or '?')
+ end, inp), 'string_list'
else
return string.gsub(tostring(inp), '[\128-\255]', '?'), 'string'
end
-
end,
- ['description'] = 'Returns the string with all non-ascii bytes replaced with the character given as second argument or `?`',
+ ['description'] = 'Returns the string with all non-ascii bytes replaced with the character ' ..
+ 'given as second argument or `?`',
['args_schema'] = {ts.string:is_optional()}
},
-- create/reuse selector to extract value for this placeholder
local selector = selector_cache[selector_expr]
if not selector then
- selector_cache[selector_expr] = lua_selectors.create_selector_closure(rspamd_config, selector_expr, '', true)
+ selector_cache[selector_expr] = lua_selectors.create_selector_closure(rspamd_config, selector_expr, '', true)
selector = selector_cache[selector_expr]
if not selector then
rspamd_logger.errx(task, 'could not create selector [%1]', selector_expr)