aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-10-11 22:59:26 +0200
committerKim Alvefur <zash@zash.se>2018-10-11 22:59:26 +0200
commit09c19925cc2d968c7e337a95ce61640a7ae48b60 (patch)
tree06428175b7508c98c32823b95b24ba9d419d2e7d /util
parenta796f87cc399939d436046c12c7bc5e634bf7bcc (diff)
downloadprosody-09c19925cc2d968c7e337a95ce61640a7ae48b60.tar.gz
prosody-09c19925cc2d968c7e337a95ce61640a7ae48b60.zip
util.serialization: Make check of prefix for optional hex encoding stricter
Diffstat (limited to 'util')
-rw-r--r--util/serialization.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/util/serialization.lua b/util/serialization.lua
index 628c9d33..cc230238 100644
--- a/util/serialization.lua
+++ b/util/serialization.lua
@@ -217,7 +217,7 @@ local function new(opt)
return '"' .. s_gsub(s, "[%z\1-\31\"\'\\\127-\255]", string_escapes) .. '"';
end
- if hex then
+ if type(hex) == "string" then
function types.string(s)
local esc = serialize_string(s);
if #esc > (#s*2+2+#hex) then