From: Jo-Philipp Wich Date: Sat, 15 Sep 2012 14:25:18 +0000 (+0000) Subject: libs/web: transparently handle userdata in write_json() X-Git-Tag: 0.11.0~89 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=b0d3b82400abc1d3ae591e3a5b313584dda612a4;p=oweals%2Fluci.git libs/web: transparently handle userdata in write_json() --- diff --git a/libs/web/luasrc/http.lua b/libs/web/luasrc/http.lua index 60a3e0722..18112507c 100644 --- a/libs/web/luasrc/http.lua +++ b/libs/web/luasrc/http.lua @@ -339,7 +339,7 @@ function write_json(x) else write(tostring(x)) end - elseif type(x) == "string" then + else write("%q" % tostring(x)) end end