aboutsummaryrefslogtreecommitdiffstats
path: root/util/template.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2017-11-23 21:00:29 +0100
committerKim Alvefur <zash@zash.se>2017-11-23 21:00:29 +0100
commitf39981045f036ca25a7263317bf02174a58004bd (patch)
tree9f9f4533b9297459ed5086b51cea0dfd9a28a153 /util/template.lua
parentf534b7005d80f6d984b8d68dc2bc557504b1d575 (diff)
downloadprosody-f39981045f036ca25a7263317bf02174a58004bd.tar.gz
prosody-f39981045f036ca25a7263317bf02174a58004bd.zip
util.template: Use util.envload instead of loadstring which is deprecated in Lua 5.2
Diffstat (limited to 'util/template.lua')
-rw-r--r--util/template.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/util/template.lua b/util/template.lua
index 04ebb93d..bc56020c 100644
--- a/util/template.lua
+++ b/util/template.lua
@@ -4,7 +4,7 @@ local setmetatable = setmetatable;
local pairs = pairs;
local ipairs = ipairs;
local error = error;
-local loadstring = loadstring;
+local envload = require "util.envload".envload;
local debug = debug;
local t_remove = table.remove;
local parse_xml = require "util.xml".parse;
@@ -72,7 +72,7 @@ local function create_cloner(stanza, chunkname)
src = src.."local _"..i.."="..lookup[i]..";";
end
src = src.."return "..name..";end";
- local f,err = loadstring(src, chunkname);
+ local f,err = envload(src, chunkname);
if not f then error(err); end
return f(setmetatable, stanza_mt);
end