# HG changeset patch # User Kim Alvefur # Date 1539291566 -7200 # Node ID 903e0cfd4cc92f70f2a2ef0fccca2b87d9678599 # Parent 8791bfa3984a96da079dd2d79729d6e9b45c99d1 util.serialization: Make check of prefix for optional hex encoding stricter diff -r 8791bfa3984a -r 903e0cfd4cc9 util/serialization.lua --- 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