Skip to content

Commit

Permalink
BlueScreen: refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Jan 2, 2020
1 parent ecf0acf commit 5e016cc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Tracy/BlueScreen/BlueScreen.php
Original file line number Diff line number Diff line change
Expand Up @@ -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"#',
'<i>$0</i>',
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
Expand Down

0 comments on commit 5e016cc

Please sign in to comment.