From 19a25777af3e2506f5c1c9a6816c8daa38431737 Mon Sep 17 00:00:00 2001 From: aheart Date: Tue, 22 Sep 2020 20:44:14 +0300 Subject: [PATCH] Filter selected text to prevent invalid XML (#4234) --- src/Psalm/Report/JunitReport.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Psalm/Report/JunitReport.php b/src/Psalm/Report/JunitReport.php index b5cf31fbd..e80649f37 100644 --- a/src/Psalm/Report/JunitReport.php +++ b/src/Psalm/Report/JunitReport.php @@ -168,7 +168,7 @@ class JunitReport extends Report $ret = 'message: ' . htmlspecialchars(trim($data->message), ENT_XML1 | ENT_QUOTES) . "\n"; $ret .= 'type: ' . trim($data->type) . "\n"; $ret .= 'snippet: ' . htmlspecialchars(trim($data->snippet), ENT_XML1 | ENT_QUOTES) . "\n"; - $ret .= 'selected_text: ' . trim($data->selected_text) . "\n"; + $ret .= 'selected_text: ' . htmlspecialchars(trim($data->selected_text)) . "\n"; $ret .= 'line: ' . $data->line_from . "\n"; $ret .= 'column_from: ' . $data->column_from . "\n"; $ret .= 'column_to: ' . $data->column_to . "\n";