Clean up and improve escaping on public-facing error pages.

This commit is contained in:
Buster Neece 2023-04-22 20:10:42 -05:00
parent c0e975294e
commit 5502087cb0
No known key found for this signature in database
GPG Key ID: F1D2E64A0005E80E
2 changed files with 21 additions and 9 deletions

View File

@ -1,17 +1,27 @@
<?php
/**
* @var Exception $exception
* @var App\Environment $environment
*/
$this->layout('minimal', [
'title' => 'Error',
'page_class' => 'error-content'
'page_class' => 'error-content',
]);
$filePath = Symfony\Component\Filesystem\Path::makeRelative(
$exception->getFile(),
$environment->getBaseDirectory()
);
?>
<div class="public-page">
<div class="card">
<div class="card-body">
<h2 class="display-1 mt-2">500</h2>
<p>
<?= $exception->getMessage() ?><br>
<?= basename($exception->getFile()) ?> : <?= $exception->getLine() ?>
<h2 class="display-1">500</h2>
<h4><?= $this->e($exception->getMessage()) ?></h4>
<p class="text-muted card-text mb-0">
<?= $this->e($filePath) ?> : L<?= $exception->getLine() ?>
</p>
<a role="button" title="<?= __('Dashboard') ?>" class="btn btn-login btn-primary btn-float" href="/">

View File

@ -10,11 +10,13 @@ $this->layout('minimal', [
<div class="public-page">
<div class="card">
<div class="card-body">
<h2 class="display-2 mt-2"><?=$exception->getCode()?></h2>
<h4><?=$exception->getMessage()?></h4>
<p><?=$exception->getDescription()?></p>
<h2 class="display-1"><?= $this->e($exception->getCode()) ?></h2>
<h4><?= $this->e($exception->getMessage()) ?></h4>
<p class="text-muted card-text mb-0">
<?= $this->e($exception->getDescription()) ?>
</p>
<a role="button" title="<?=__('Dashboard')?>" class="btn btn-login btn-primary btn-float"
<a role="button" title="<?= __('Dashboard') ?>" class="btn btn-login btn-primary btn-float"
href="/">
<i class="material-icons" aria-hidden="true">home</i>
</a>