8000 bug #35588 [ErrorHandler] Escape variable in Exception template (jder… · symfony/symfony@eaec5d6 · GitHub
[go: up one dir, main page]

Skip to content

Commit eaec5d6

Browse files
committed
bug #35588 [ErrorHandler] Escape variable in Exception template (jderusse)
This PR was merged into the 4.4 branch. Discussion ---------- [ErrorHandler] Escape variable in Exception template | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | / | License | MIT | Doc PR | / Commits ------- 629d21b Escape variable in Exception Template
2 parents f312e3c + 629d21b commit eaec5d6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Symfony/Component/ErrorHandler/Resources/views/traces_text.html.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@
2020
<?php if ($exception['trace']) { ?>
2121
<pre class="stacktrace">
2222
<?php
23-
echo $exception['class'].":\n";
23+
echo $this->escape($exception['class']).":\n";
2424
if ($exception['message']) {
25-
echo $exception['message']."\n";
25+
echo $this->escape($exception['message'])."\n";
2626
}
2727

2828
foreach ($exception['trace'] as $trace) {
2929
echo "\n ";
3030
if ($trace['function']) {
31-
echo 'at '.$trace['class'].$trace['type'].$trace['function'].'('.(isset($trace['args']) ? $this->formatArgsAsText($trace['args']) : '').')';
31+
echo $this->escape('at '.$trace['class'].$trace['type'].$trace['function']).'('.(isset($trace['args']) ? $this->formatArgsAsText($trace['args']) : '').')';
3232
}
3333
if ($trace['file'] && $trace['line']) {
3434
echo($trace['function'] ? "\n (" : 'at ').strtr(strip_tags($this->formatFile($trace['file'], $trace['line'])), [' at line '.$trace['line'] => '']).':'.$trace['line'].($trace['function'] ? ')' : '');

0 commit comments

Comments
 (0)
0