Skip to content

Commit c6efc35

Browse files
committed
ICL: HtmlFormatter continued.
1 parent e14519f commit c6efc35

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/Log/HtmlFormatter.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,7 @@ protected function composeDetails(array $record)
8484
$details .= $this->composeRow('Message', (string) $record['message']);
8585
if (!empty($record['context'])) {
8686
$context = $this->convertToString($record['context']);
87-
$context = e($context);
88-
$details .= $this->composeRow('Context', "<pre>{$context}</pre>", false);
87+
$details .= $this->composeRow('Context', $context);
8988
}
9089
$details .= $this->composeRow('Time', $record['datetime']->format($this->dateFormat));
9190
$details .= $this->composeRow('Environment', app()->environment());
@@ -95,11 +94,13 @@ protected function composeDetails(array $record)
9594
return $details;
9695
}
9796

98-
protected function composeRow($header, $body = ' ', $escapeBody = true)
97+
protected function composeRow($header, $body = ' ')
9998
{
10099
$header = e($header);
101-
if ($escapeBody) {
102-
$body = e($body);
100+
$body = e($body);
101+
102+
if ($header == 'Context') {
103+
$body = "<pre>{$body}</pre>";
103104
}
104105

105106
return "<tr class='details-row'>

0 commit comments

Comments
 (0)