aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2016-11-20 12:03:24 +0100
committerKim Alvefur <zash@zash.se>2016-11-20 12:03:24 +0100
commiteb67213599670c9453dd32e37ed9f1bc7d809f96 (patch)
tree23e3a46fa70a467ed71a82881dfbfa02a748b3a3
parent18f15461dea778dfe006329ff520a2b7bf5dae2f (diff)
downloadprosody-eb67213599670c9453dd32e37ed9f1bc7d809f96.tar.gz
prosody-eb67213599670c9453dd32e37ed9f1bc7d809f96.zip
util.datamanager: Use the 'base' argument to tonumber() to indicate hexadecimal
-rw-r--r--util/datamanager.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/util/datamanager.lua b/util/datamanager.lua
index 2884b942..148605d9 100644
--- a/util/datamanager.lua
+++ b/util/datamanager.lua
@@ -50,7 +50,7 @@ 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));