Skip to content
Snippets Groups Projects
Commit 530b6f63 authored by Markus Klein's avatar Markus Klein Committed by Anja Leichsenring
Browse files

[BUGFIX] Apply hsc() to exception debug output

Resolves: #72755
Releases: master, 7.6, 6.2
Change-Id: If62a72ccc0f8daa47b5cd67b1e2f3fb30f2bf1dc
Reviewed-on: https://review.typo3.org/45980


Reviewed-by: default avatarGeorg Ringer <georg.ringer@gmail.com>
Tested-by: default avatarGeorg Ringer <georg.ringer@gmail.com>
Reviewed-by: default avatarMartin Kutschker <martin.kutschker@ymail.com>
Reviewed-by: default avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: default avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
parent eb52636d
Branches
Tags
No related merge requests found
...@@ -142,13 +142,13 @@ Uncaught TYPO3 Exception ' . $exceptionCodeNumber . $exception->getMessage() . L ...@@ -142,13 +142,13 @@ Uncaught TYPO3 Exception ' . $exceptionCodeNumber . $exception->getMessage() . L
$backtraceCode = ''; $backtraceCode = '';
if (!empty($trace)) { if (!empty($trace)) {
foreach ($trace as $index => $step) { foreach ($trace as $index => $step) {
$class = isset($step['class']) ? $step['class'] . '<span style="color:white;">::</span>' : ''; $class = isset($step['class']) ? htmlspecialchars($step['class']) . '<span style="color:white;">::</span>' : '';
$arguments = ''; $arguments = '';
if (isset($step['args']) && is_array($step['args'])) { if (isset($step['args']) && is_array($step['args'])) {
foreach ($step['args'] as $argument) { foreach ($step['args'] as $argument) {
$arguments .= (string)$arguments === '' ? '' : '<span style="color:white;">,</span> '; $arguments .= (string)$arguments === '' ? '' : '<span style="color:white;">,</span> ';
if (is_object($argument)) { if (is_object($argument)) {
$arguments .= '<span style="color:#FF8700;"><em>' . get_class($argument) . '</em></span>'; $arguments .= '<span style="color:#FF8700;"><em>' . htmlspecialchars(get_class($argument)) . '</em></span>';
} elseif (is_string($argument)) { } elseif (is_string($argument)) {
$preparedArgument = strlen($argument) < 100 $preparedArgument = strlen($argument) < 100
? $argument ? $argument
...@@ -201,13 +201,13 @@ Uncaught TYPO3 Exception ' . $exceptionCodeNumber . $exception->getMessage() . L ...@@ -201,13 +201,13 @@ Uncaught TYPO3 Exception ' . $exceptionCodeNumber . $exception->getMessage() . L
$phpFileCount = count($phpFile); $phpFileCount = count($phpFile);
$endLine = $lineNumber < $phpFileCount - 2 ? $lineNumber + 3 : $phpFileCount + 1; $endLine = $lineNumber < $phpFileCount - 2 ? $lineNumber + 3 : $phpFileCount + 1;
if ($endLine > $startLine) { if ($endLine > $startLine) {
$codeSnippet = '<br /><span style="font-size:10px;">' . $filePathAndName . ':</span><br /><pre>'; $codeSnippet = '<br /><span style="font-size:10px;">' . htmlspecialchars($filePathAndName) . ':</span><br /><pre>';
for ($line = $startLine; $line < $endLine; $line++) { for ($line = $startLine; $line < $endLine; $line++) {
$codeLine = str_replace(TAB, ' ', $phpFile[$line - 1]); $codeLine = str_replace(TAB, ' ', $phpFile[$line - 1]);
if ($line === $lineNumber) { if ($line === $lineNumber) {
$codeSnippet .= '</pre><pre style="background-color: #F1F1F1; color: black;">'; $codeSnippet .= '</pre><pre style="background-color: #F1F1F1; color: black;">';
} }
$codeSnippet .= sprintf('%05d', $line) . ': ' . $codeLine; $codeSnippet .= sprintf('%05d', $line) . ': ' . htmlspecialchars($codeLine);
if ($line === $lineNumber) { if ($line === $lineNumber) {
$codeSnippet .= '</pre><pre>'; $codeSnippet .= '</pre><pre>';
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment