From: Andrew Lewis Date: Tue, 14 Oct 2025 10:54:31 +0000 (+0200) Subject: [Fix] Multimap: deal with symbols with leading numerals X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1f4829a0e8a00517df7c0612a0ddde2705194cfc;p=thirdparty%2Frspamd.git [Fix] Multimap: deal with symbols with leading numerals --- diff --git a/src/plugins/lua/multimap.lua b/src/plugins/lua/multimap.lua index 21f4e3e67b..1b186ef7f9 100644 --- a/src/plugins/lua/multimap.lua +++ b/src/plugins/lua/multimap.lua @@ -72,7 +72,7 @@ local function parse_multimap_value(parse_rule, p_ret) (number.fractional ^ -1)) + -- Fractional (lpeg.S("+-") * number.fractional) -- Completely fractional number - local sym_start = lpeg.R("az", "AZ") + lpeg.S("_") + local sym_start = lpeg.R("az", "AZ", "09") + lpeg.S("_") local sym_elt = sym_start + lpeg.R("09") local symbol = sym_start * sym_elt ^ 0 local symbol_cap = lpeg.Cg(symbol, 'symbol') @@ -80,7 +80,7 @@ local function parse_multimap_value(parse_rule, p_ret) local opts_cap = lpeg.Cg(lpeg.Ct(lpeg.C(symbol) * (lpeg.P(",") * lpeg.C(symbol)) ^ 0), 'opts') local symscore_cap = (symbol_cap * lpeg.P(":") * score_cap) local symscoreopt_cap = symscore_cap * lpeg.P(":") * opts_cap - local grammar = symscoreopt_cap + symscore_cap + symbol_cap + score_cap + local grammar = symscoreopt_cap + symscore_cap + score_cap + symbol_cap multimap_grammar = lpeg.Ct(grammar) end local tbl = multimap_grammar:match(p_ret)