aboutsummaryrefslogtreecommitdiffstats
path: root/lualib/lua_selectors.lua
diff options
context:
space:
mode:
authorMikhail Galanin <mgalanin@mimecast.com>2018-09-20 09:41:36 +0100
committerMikhail Galanin <mgalanin@mimecast.com>2018-09-20 09:41:36 +0100
commitca61c951dcdac1093b3b507dd42c94b5363ff701 (patch)
tree3990eef4fb0e23b01489e97119a1033f9b59bdaa /lualib/lua_selectors.lua
parent0386a2a6964f4e9792417dcdc10d418058fa0c93 (diff)
downloadrspamd-ca61c951dcdac1093b3b507dd42c94b5363ff701.tar.gz
rspamd-ca61c951dcdac1093b3b507dd42c94b5363ff701.zip
[Minor] logical error, get_variable() accepts either one or two arguments
When second argument is nil it still considered as two arguments call, however 2nd one is expected to be string.
Diffstat (limited to 'lualib/lua_selectors.lua')
-rw-r--r--lualib/lua_selectors.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/lualib/lua_selectors.lua b/lualib/lua_selectors.lua
index d93b11df6..983f28589 100644
--- a/lualib/lua_selectors.lua
+++ b/lualib/lua_selectors.lua
@@ -244,7 +244,8 @@ e.g. `get_user`]],
-- the second argument is optional and defines the type (string by default)
['pool_var'] = {
['get_value'] = function(task, args)
- return task:get_mempool():get_variable(args[1], args[2]),(args[2] or 'string')
+ local type = args[2] or 'string'
+ return task:get_mempool():get_variable(args[1], type),(type)
end,
['description'] = [[Get specific pool var. The first argument must be variable name,
the second argument is optional and defines the type (string by default)]],