diff options
author | Kim Alvefur <zash@zash.se> | 2016-11-20 12:03:24 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2016-11-20 12:03:24 +0100 |
commit | eb67213599670c9453dd32e37ed9f1bc7d809f96 (patch) | |
tree | 23e3a46fa70a467ed71a82881dfbfa02a748b3a3 | |
parent | 18f15461dea778dfe006329ff520a2b7bf5dae2f (diff) | |
download | prosody-eb67213599670c9453dd32e37ed9f1bc7d809f96.tar.gz prosody-eb67213599670c9453dd32e37ed9f1bc7d809f96.zip |
util.datamanager: Use the 'base' argument to tonumber() to indicate hexadecimal
-rw-r--r-- | util/datamanager.lua | 2 |
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)); |