X-Git-Url: https://git.enpas.org/?a=blobdiff_plain;f=util%2Fjson.lua;h=a8a58afcd12062267cf63414d905e9d6c75c75bc;hb=95dfe4b0aaaf26ee4651c09eb9757c56210a135a;hp=82ebcc4330ef61e56f3185f9cbd75a4f7554500c;hpb=520c1a79bf7a70924dbddd23aa81938573db2812;p=prosody.git diff --git a/util/json.lua b/util/json.lua index 82ebcc43..a8a58afc 100644 --- a/util/json.lua +++ b/util/json.lua @@ -348,9 +348,9 @@ local first_escape = { function json.decode(json) json = json:gsub("\\.", first_escape) -- get rid of all escapes except \uXXXX, making string parsing much simpler --:gsub("[\r\n]", "\t"); -- \r\n\t are equivalent, we care about none of them, and none of them can be in strings - + -- TODO do encoding verification - + local val, index = _readvalue(json, 1); if val == nil then return val, index; end if json:find("[^ \t\r\n]", index) then return nil, "garbage at eof"; end