luci-base: fix backslash escaping in luci.util.serialize_json()

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
This commit is contained in:
Jo-Philipp Wich 2015-03-18 12:43:29 +01:00
parent 4ab6dcea9b
commit 6160a53ab9

View file

@ -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