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
commit812c872f7a3a389864d72a1017cfb350a0a33aa1 (patch)
tree9f9f4533b9297459ed5086b51cea0dfd9a28a153 /util/template.lua
parent2facc56274dd9156b2d02d87e2e296d3c530332d (diff)
downloadprosody-812c872f7a3a389864d72a1017cfb350a0a33aa1.tar.gz
prosody-812c872f7a3a389864d72a1017cfb350a0a33aa1.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