aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2016-11-21 02:40:47 +0100
committerKim Alvefur <zash@zash.se>2016-11-21 02:40:47 +0100
commitfd4206fdb2dc539efb8c2275dbaf3599a72c4933 (patch)
tree62ffc114d6f84139c60043dba1936d9606f9b6ba /util
parent9d8ddba6ca4e2fcdb8939e521fd194fc0d34f680 (diff)
parent58a712e247dbaede24c3297260bae145e0ede16e (diff)
downloadprosody-fd4206fdb2dc539efb8c2275dbaf3599a72c4933.tar.gz
prosody-fd4206fdb2dc539efb8c2275dbaf3599a72c4933.zip
Merge 0.10->trunk
Diffstat (limited to 'util')
-rw-r--r--util/datamanager.lua4
-rw-r--r--util/envload.lua1
2 files changed, 3 insertions, 2 deletions
diff --git a/util/datamanager.lua b/util/datamanager.lua
index 2884b942..585bb83d 100644
--- a/util/datamanager.lua
+++ b/util/datamanager.lua
@@ -50,10 +50,10 @@ local _ENV = nil;
---- utils -----
local encode, decode;
do
- local urlcodes = setmetatable({}, { __index = function (t, k) t[k] = char(tonumber("0x"..k)); return t[k]; end });
+ local urlcodes = setmetatable({}, { __index = function (t, k) t[k] = char(tonumber(k, 16)); return t[k]; end });
decode = function (s)
- return s and (s:gsub("+", " "):gsub("%%([a-fA-F0-9][a-fA-F0-9])", urlcodes));
+ return s and (s:gsub("%%(%x%x)", urlcodes));
end
encode = function (s)
diff --git a/util/envload.lua b/util/envload.lua
index 53e28348..3c5190df 100644
--- a/util/envload.lua
+++ b/util/envload.lua
@@ -4,6 +4,7 @@
-- This project is MIT/X11 licensed. Please see the
-- COPYING file in the source package for more information.
--
+-- luacheck: ignore 113/setfenv
local load, loadstring, loadfile, setfenv = load, loadstring, loadfile, setfenv;
local envload;