aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
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;