From 5e016cc98940f72457836e34d3ed18d9d5701663 Mon Sep 17 00:00:00 2001 From: David Grudl Date: Fri, 27 Dec 2019 20:01:00 +0100 Subject: [PATCH] BlueScreen: refactoring --- src/Tracy/BlueScreen/BlueScreen.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Tracy/BlueScreen/BlueScreen.php b/src/Tracy/BlueScreen/BlueScreen.php index eb0b7b556..d414f0df6 100644 --- a/src/Tracy/BlueScreen/BlueScreen.php +++ b/src/Tracy/BlueScreen/BlueScreen.php @@ -113,11 +113,14 @@ public function renderToFile(\Throwable $exception, string $file): bool private function renderTemplate(\Throwable $exception, string $template, $toScreen = true): void { + $messageHtml = Dumper::encodeString((string) $exception->getMessage(), self::MAX_MESSAGE_LENGTH); + $messageHtml = htmlspecialchars($messageHtml, ENT_SUBSTITUTE, 'UTF-8'); $messageHtml = preg_replace( '#\'\S(?:[^\']|\\\\\')*\S\'|"\S(?:[^"]|\\\\")*\S"#', '$0', - htmlspecialchars(Dumper::encodeString((string) $exception->getMessage(), self::MAX_MESSAGE_LENGTH), ENT_SUBSTITUTE, 'UTF-8') + $messageHtml ); + $info = array_filter($this->info); $source = Helpers::getSource(); $title = $exception instanceof \ErrorException