luci-base: fix backslash escaping in luci.util.serialize_json()
[project/luci.git] / modules / luci-base / luasrc / util.lua
index 8b28b17..dcf8230 100644 (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