From cd8f883199e5f140d1152f0c8da8aad347eadf4f Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Thu, 11 Oct 2018 22:59:26 +0200 Subject: util.serialization: Make check of prefix for optional hex encoding stricter --- util/serialization.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'util') 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 -- cgit v1.2.3