Escape LegacyDevelopmentTest output

This commit is contained in:
Igor Scheller 2020-04-05 19:32:55 +02:00
parent 59e060cd39
commit ba1c658b92
2 changed files with 8 additions and 2 deletions

View File

@ -26,7 +26,13 @@ class LegacyDevelopment extends Legacy
'file' => $file . ':' . $e->getLine(),
'stacktrace' => $this->formatStackTrace($e->getTrace()),
];
ob_start(function (string $buffer) {
return htmlspecialchars($buffer);
});
var_dump($data);
ob_end_flush();
echo '</pre>';
}

View File

@ -19,10 +19,10 @@ class LegacyDevelopmentTest extends TestCase
$handler = new LegacyDevelopment();
/** @var Request|MockObject $request */
$request = $this->createMock(Request::class);
$exception = new ErrorException('Lorem Ipsum', 4242, 1, 'foo.php', 9999);
$exception = new ErrorException('Lorem <b>Ipsum</b>', 4242, 1, 'foo.php', 9999);
$regex = sprintf(
'%%<pre.*>.*ErrorException.*4242.*Lorem Ipsum.*%s.*%s.*%s.*</pre>%%is',
'%%<pre.*>.*ErrorException.*4242.*Lorem &lt;b&gt;Ipsum&lt;/b&gt;.*%s.*%s.*%s.*</pre>%%is',
'foo.php',
9999,
__FUNCTION__