Skip to content

Commit

Permalink
bug #35588 [ErrorHandler] Escape variable in Exception template (jder…
Browse files Browse the repository at this point in the history
…usse)

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
  • Loading branch information
fabpot committed Feb 4, 2020
2 parents f312e3c + 629d21b commit eaec5d6
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -20,15 +20,15 @@
<?php if ($exception['trace']) { ?>
<pre class="stacktrace">
<?php
echo $exception['class'].":\n";
echo $this->escape($exception['class']).":\n";
if ($exception['message']) {
echo $exception['message']."\n";
echo $this->escape($exception['message'])."\n";
}

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

0 comments on commit eaec5d6

Please sign in to comment.