diff options
author | Kim Alvefur <zash@zash.se> | 2022-01-27 21:14:22 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2022-01-27 21:14:22 +0100 |
commit | c551d3d8dd756816b550dadb9e226c2d3ea6f334 (patch) | |
tree | ab0d9de069e9388a4592635c9df40b79670cd72b /util | |
parent | d607d2898fc63f08c4143efc07b8eff7bb2e42a4 (diff) | |
download | prosody-c551d3d8dd756816b550dadb9e226c2d3ea6f334.tar.gz prosody-c551d3d8dd756816b550dadb9e226c2d3ea6f334.zip |
util.format: Skip control code escaping when doing full serialization
Fixes that a multi-line string ended up "like\
\9this" instead of "like\nthis" as can be demonstrated by somehow
initiating a connection to a HTTP server.
Diffstat (limited to 'util')
-rw-r--r-- | util/format.lua | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/util/format.lua b/util/format.lua index 1cd8d81b..533f3a82 100644 --- a/util/format.lua +++ b/util/format.lua @@ -108,7 +108,7 @@ local function format(formatstring, ...) if t == "string" and option ~= "p" then if not valid_utf8(arg) then option = "q"; - else + elseif option ~= "q" then -- gets fully escaped in the next block args[i] = arg:gsub("[%z\1-\8\11-\31\127]", control_symbols):gsub("\n\t?", "\n\t"); return spec; end |