From 6160a53ab992e998adcda7119e49096a65a7f5de Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Wed, 18 Mar 2015 12:43:29 +0100 Subject: [PATCH] luci-base: fix backslash escaping in luci.util.serialize_json() Signed-off-by: Jo-Philipp Wich --- modules/luci-base/luasrc/util.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/luci-base/luasrc/util.lua b/modules/luci-base/luasrc/util.lua index 8b28b1752..dcf8230b3 100644 --- a/modules/luci-base/luasrc/util.lua +++ b/modules/luci-base/luasrc/util.lua @@ -643,7 +643,7 @@ function serialize_json(x, cb) push(tostring(x)) end else - push('"%s"' % tostring(x):gsub('["%z\1-\31]', + push('"%s"' % tostring(x):gsub('["%z\1-\31\\]', function(c) return '\\u%04x' % c:byte(1) end)) end -- 2.25.1