Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Clean up and improve escaping on public-facing error pages.
  • Loading branch information
BusterNeece committed Apr 23, 2023
1 parent c0e9752 commit 5502087
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 9 deletions.
20 changes: 15 additions & 5 deletions templates/system/error_general.phtml
@@ -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="/">
Expand Down
10 changes: 6 additions & 4 deletions templates/system/error_http.phtml
Expand Up @@ -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>
Expand Down

0 comments on commit 5502087

Please sign in to comment.