aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-12-13 16:34:55 +0100
committerKim Alvefur <zash@zash.se>2021-12-13 16:34:55 +0100
commit58c91153514c6e07ba3bed20473a92d87ddd3ca5 (patch)
tree87f8f4755afc8ba49eeabeca279898ab9260e632 /util
parent283042d7c3ae7e7b25a51e71be736c84a71a0bd7 (diff)
downloadprosody-58c91153514c6e07ba3bed20473a92d87ddd3ca5.tar.gz
prosody-58c91153514c6e07ba3bed20473a92d87ddd3ca5.zip
util.format: Ensure metatable __tostring results are also sanitized
Diffstat (limited to 'util')
-rw-r--r--util/format.lua3
1 files changed, 2 insertions, 1 deletions
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