aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/storage/sqlbasic.lib.lua
diff options
context:
space:
mode:
authorFlorian Zeitz <florob@babelmonkeys.de>2012-06-08 05:04:38 +0200
committerFlorian Zeitz <florob@babelmonkeys.de>2012-06-08 05:04:38 +0200
commitd49b9bc2abb50b22ae3d6739d96423e9dadfeda8 (patch)
tree28c1bcbab960b28cc27f30e8ab0c04e30f11da2d /plugins/storage/sqlbasic.lib.lua
parent217e6d011c8d8ae2c44034fc9138925d77c3c10b (diff)
downloadprosody-d49b9bc2abb50b22ae3d6739d96423e9dadfeda8.tar.gz
prosody-d49b9bc2abb50b22ae3d6739d96423e9dadfeda8.zip
Eliminate direct setfenv usage
Diffstat (limited to 'plugins/storage/sqlbasic.lib.lua')
-rw-r--r--plugins/storage/sqlbasic.lib.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/storage/sqlbasic.lib.lua b/plugins/storage/sqlbasic.lib.lua
index f1202287..ab3648f9 100644
--- a/plugins/storage/sqlbasic.lib.lua
+++ b/plugins/storage/sqlbasic.lib.lua
@@ -3,12 +3,12 @@
-- This driver stores data as simple key-values
local ser = require "util.serialization".serialize;
+local envload = require "util.envload".envload;
local deser = function(data)
module:log("debug", "deser: %s", tostring(data));
if not data then return nil; end
- local f = loadstring("return "..data);
+ local f = envload("return "..data, nil, {});
if not f then return nil; end
- setfenv(f, {});
local s, d = pcall(f);
if not s then return nil; end
return d;