Software /
code /
prosody
Comparison
plugins/mod_storage_sql.lua @ 3863:2a9475dce7ff
mod_storage_sql: Fixed the deserialization of string-typed values.
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Mon, 13 Dec 2010 19:27:14 +0500 |
parent | 3854:5a1551d604b1 |
child | 3744:ed76b64da9d1 |
comparison
equal
deleted
inserted
replaced
3862:ec8bcd766693 | 3863:2a9475dce7ff |
---|---|
72 return nil, err; | 72 return nil, err; |
73 end | 73 end |
74 return nil, "Unhandled value type: "..t; | 74 return nil, "Unhandled value type: "..t; |
75 end | 75 end |
76 local function deserialize(t, value) | 76 local function deserialize(t, value) |
77 if t == "string" then return t; | 77 if t == "string" then return value; |
78 elseif t == "boolean" then | 78 elseif t == "boolean" then |
79 if value == "true" then return true; | 79 if value == "true" then return true; |
80 elseif value == "false" then return false; end | 80 elseif value == "false" then return false; end |
81 elseif t == "number" then return tonumber(value); | 81 elseif t == "number" then return tonumber(value); |
82 elseif value == "json" then | 82 elseif value == "json" then |