diff --git a/src/Exceptions/Handlers/LegacyDevelopment.php b/src/Exceptions/Handlers/LegacyDevelopment.php index 34c52571..335ce87c 100644 --- a/src/Exceptions/Handlers/LegacyDevelopment.php +++ b/src/Exceptions/Handlers/LegacyDevelopment.php @@ -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 ''; } diff --git a/tests/Unit/Exceptions/Handlers/LegacyDevelopmentTest.php b/tests/Unit/Exceptions/Handlers/LegacyDevelopmentTest.php index f7355f76..fb929459 100644 --- a/tests/Unit/Exceptions/Handlers/LegacyDevelopmentTest.php +++ b/tests/Unit/Exceptions/Handlers/LegacyDevelopmentTest.php @@ -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 Ipsum', 4242, 1, 'foo.php', 9999); $regex = sprintf( - '%%