From: Dmitry Petrov Date: Tue, 4 Mar 2025 16:16:25 +0000 (-0500) Subject: Fix support for "map://" prefix X-Git-Tag: 3.11.1~5^2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=95a2af966aac443d25c903a73cd7f6cb55254f63;p=thirdparty%2Frspamd.git Fix support for "map://" prefix --- diff --git a/lualib/lua_maps.lua b/lualib/lua_maps.lua index 2699ea2148..6dad3b6ad1 100644 --- a/lualib/lua_maps.lua +++ b/lualib/lua_maps.lua @@ -526,15 +526,12 @@ local function rspamd_maybe_check_map(key, what) return rspamd_maybe_check_map(key, elt) end, what) end - if type(rspamd_maps) == "table" then - local mn - if starts(key, "map:") then - mn = string.sub(key, 5) - elseif starts(key, "map://") then - mn = string.sub(key, 7) + if type(rspamd_maps) == "table" and starts(key, "map:") then + local mn = string.sub(key, 5) + if starts(mn, "//") then + mn = string.sub(mn, 3) end - - if mn and rspamd_maps[mn] then + if rspamd_maps[mn] then return rspamd_maps[mn]:get_key(what) end end