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