Browse Source

[Fix] Fix replacements to sanitize '%' character

tags/1.4.1
Vsevolod Stakhov 7 years ago
parent
commit
19e9e19dfd
1 changed files with 3 additions and 2 deletions
  1. 3
    2
      src/plugins/lua/spamassassin.lua

+ 3
- 2
src/plugins/lua/spamassassin.lua View File

@@ -1101,8 +1101,9 @@ local function apply_replacements(str)
local sstr
sstr = s
fun.each(function(n, t)
sstr = string.gsub(sstr, string.format("<%s>", n),
string.format("%s%s%s", pre, t, post))
local rep = string.format("%s%s%s", pre, t, post)
rep = string.gsub(rep, '%%', '%%%%')
sstr = string.gsub(sstr, string.format("<%s>", n), rep)
end, replace['tags'])

return sstr

Loading…
Cancel
Save