commit e39da52: [Fix] Clickhouse: escape carriage return

Andrew Lewis nerf at judo.za.org
Mon Nov 9 11:56:07 UTC 2020


Author: Andrew Lewis
Date: 2020-11-09 12:53:23 +0200
URL: https://github.com/rspamd/rspamd/commit/e39da522f8a47c8f411ba4e6ec74d7fc4ab6f064 (refs/pull/3547/head)

[Fix] Clickhouse: escape carriage return

---
 lualib/lua_clickhouse.lua | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lualib/lua_clickhouse.lua b/lualib/lua_clickhouse.lua
index 8891a89fc..e532cd643 100644
--- a/lualib/lua_clickhouse.lua
+++ b/lualib/lua_clickhouse.lua
@@ -45,11 +45,12 @@ end
 
 local function clickhouse_quote(str)
   if str then
-    return str:gsub('[\'\\\n\t]', {
+    return str:gsub('[\'\\\n\t\r]', {
       ['\''] = [[\']],
       ['\\'] = [[\\]],
       ['\n'] = [[\n]],
       ['\t'] = [[\t]],
+      ['\r'] = [[\r]],
     })
   end
 


More information about the Commits mailing list