Diff

plugins/mod_c2s.lua @ 9784:7fa273f8869e

mod_c2s, mod_s2s, mod_component: Log invalid XML escaped (fixes #734) See 6ed0d6224d64
author Kim Alvefur <zash@zash.se>
date Tue, 15 Jan 2019 20:08:30 +0100
parent 9739:a74d78f79b23
child 9910:7a703af90c9c
line wrap: on
line diff
--- a/plugins/mod_c2s.lua	Mon Jan 14 00:17:02 2019 +0100
+++ b/plugins/mod_c2s.lua	Tue Jan 15 20:08:30 2019 +0100
@@ -290,7 +290,7 @@
 			if data then
 				local ok, err = stream:feed(data);
 				if not ok then
-					log("debug", "Received invalid XML (%s) %d bytes: %s", tostring(err), #data, data:sub(1, 300):gsub("[\r\n]+", " "):gsub("[%z\1-\31]", "_"));
+					log("debug", "Received invalid XML (%s) %d bytes: %q", tostring(err), #data, data:sub(1, 300));
 					session:close("not-well-formed");
 				end
 			end