Software /
code /
prosody
Diff
plugins/mod_storage_sql.lua @ 3772:e1f6fe098404
mod_storage_sql: Fix a couple of bugs in "JSON" decoding
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Sat, 18 Dec 2010 03:25:31 +0000 |
parent | 3744:ed76b64da9d1 |
child | 3974:af40a7ce4f77 |
line wrap: on
line diff
--- a/plugins/mod_storage_sql.lua Sat Dec 18 02:33:47 2010 +0000 +++ b/plugins/mod_storage_sql.lua Sat Dec 18 03:25:31 2010 +0000 @@ -25,7 +25,7 @@ local pairs = pairs; local next = next; local setmetatable = setmetatable; -local json = { stringify = function(s) return require"util.serialization".serialize(s) end, parse = require"util.serialization".deserialze }; +local json = { stringify = function(s) return require"util.serialization".serialize(s) end, parse = require"util.serialization".deserialize }; local connection = ...; local host,user,store = module.host; @@ -79,7 +79,7 @@ if value == "true" then return true; elseif value == "false" then return false; end elseif t == "number" then return tonumber(value); - elseif value == "json" then + elseif t == "json" then return json.parse(value); end end