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
commit5759ed4bd315c197324c65375be019040d273203 (patch)
tree62ffc114d6f84139c60043dba1936d9606f9b6ba /util
parentfa06e78161ae895c625f78ed745766d4569d6876 (diff)
parentf36fed39e8110ee3c36e0587811ce3268ae6690e (diff)
downloadprosody-5759ed4bd315c197324c65375be019040d273203.tar.gz
prosody-5759ed4bd315c197324c65375be019040d273203.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;