Software /
code /
prosody
Diff
util/serialization.lua @ 9483:903e0cfd4cc9
util.serialization: Make check of prefix for optional hex encoding stricter
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 11 Oct 2018 22:59:26 +0200 |
parent | 9480:006a71a83e6a |
child | 9484:1d1541630c20 |
line wrap: on
line diff
--- a/util/serialization.lua Thu Oct 11 22:50:45 2018 +0200 +++ b/util/serialization.lua Thu Oct 11 22:59:26 2018 +0200 @@ -217,7 +217,7 @@ 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