From 58c91153514c6e07ba3bed20473a92d87ddd3ca5 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Mon, 13 Dec 2021 16:34:55 +0100 Subject: util.format: Ensure metatable __tostring results are also sanitized --- util/format.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'util') diff --git a/util/format.lua b/util/format.lua index efd92e3d..e93c9096 100644 --- a/util/format.lua +++ b/util/format.lua @@ -70,7 +70,8 @@ local function format(formatstring, ...) -- No UTF-8 or control characters, assumed to be the common case. return elseif option == "s" and t ~= "string" then - args[i] = tostring(arg); + arg = tostring(arg); + t = "string"; end if option ~= "s" and option ~= "q" and option ~= "p" then -- cgit v1.2.3