Diff

plugins/mod_storage_sql.lua @ 3891:f82af9f7f1cd

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 3864:345f1d5b7022
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