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
commite3ab638262a338df9f31b351a47c430f9e067832 (patch)
tree23e3a46fa70a467ed71a82881dfbfa02a748b3a3
parentfdf2a552ce5930cb72bdf8e302637b68359f2df3 (diff)
downloadprosody-e3ab638262a338df9f31b351a47c430f9e067832.tar.gz
prosody-e3ab638262a338df9f31b351a47c430f9e067832.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));