mod_storage_sql: Fix a couple of bugs in "JSON" decoding
authorMatthew Wild <mwild1@gmail.com>
Sat, 18 Dec 2010 03:25:31 +0000 (03:25 +0000)
committerMatthew Wild <mwild1@gmail.com>
Sat, 18 Dec 2010 03:25:31 +0000 (03:25 +0000)
plugins/mod_storage_sql.lua

index e3eb3c7747deafe475b67689967f34f490545a31..3d5aa0a371e3714d424dbf8df7a6f7ba48d5a033 100644 (file)
@@ -25,7 +25,7 @@ local tonumber = tonumber;
 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 @@ local function deserialize(t, value)
                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