]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Lua_mime: One more offset fix
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 30 Oct 2020 12:09:00 +0000 (12:09 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 30 Oct 2020 12:09:00 +0000 (12:09 +0000)
lualib/lua_mime.lua

index aab61cb77551075e4bd8fbfb8f90292337bba4d4..76e3c6195880dde7da1c117a2aad7af615a96a1a 100644 (file)
@@ -354,7 +354,7 @@ local function do_replacement (task, part, mp, replacements,
     local fragments = {}
     for _,m in ipairs(matches_flattened) do
       if m[1][1] > cur_start then
-        fragments[#fragments + 1] = content:span(cur_start, m[1][1] - cur_start)
+        fragments[#fragments + 1] = content:sub(cur_start, m[1][1])
         fragments[#fragments + 1] = replacements[m[2]]
         cur_start = m[1][2] + 1 -- end of match
       end