Skip to content

Commit

Permalink
[Fix] Lua_maps: Fix adjustments for the map type in the complex map d…
Browse files Browse the repository at this point in the history
…efinitions
  • Loading branch information
vstakhov committed Mar 13, 2021
1 parent e2d4415 commit 9d8a5db
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions lualib/lua_maps.lua
Expand Up @@ -153,6 +153,20 @@ local function rspamd_map_add_from_ucl(opt, mtype, description)
end
if opt[1] then
-- Adjust each element if needed
local adjusted
for i,source in ipairs(opt) do
local nsrc,ntype = maybe_adjust_type(source, mtype)
if mtype ~= ntype then
if not adjusted then
mtype = ntype
end
adjusted = true
end
opt[i] = nsrc
end
if mtype == 'radix' then
if string.find(opt[1], '^%d') then
Expand Down

0 comments on commit 9d8a5db

Please sign in to comment.