Skip to content

Commit

Permalink
Add missing HTML encoding to templates.
Browse files Browse the repository at this point in the history
These templates were missing encoding and we were notified by Nancer
via the responsible disclosure process.
  • Loading branch information
markstory committed May 21, 2018
1 parent f9cd66f commit 1ea0c87
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/Template/Error/duplicate_named_route.ctp
Expand Up @@ -25,7 +25,7 @@ $attributes = $error->getAttributes();
$this->start('subheading');
?>
<strong>Error: </strong>
<?= $error->getMessage(); ?>
<?= h($error->getMessage()); ?>
<?php $this->end() ?>

<?php $this->start('file') ?>
Expand All @@ -50,9 +50,9 @@ Remove duplicate route names in your route configuration.</p>
echo '<tr>';
printf(
'<td width="25%%">%s</td><td>%s</td><td width="20%%">%s</td>',
$other->template,
Debugger::exportVar($other->defaults),
Debugger::exportVar($other->options)
h($other->template),
h(Debugger::exportVar($other->defaults)),
h(Debugger::exportVar($other->options))
);
echo '</tr>';
?>
Expand Down
10 changes: 5 additions & 5 deletions src/Template/Error/missing_route.ctp
Expand Up @@ -26,7 +26,7 @@ $attributes = $error->getAttributes();
$this->start('subheading');
?>
<strong>Error: </strong>
<?= $error->getMessage(); ?>
<?= h($error->getMessage()); ?>
<?php $this->end() ?>

<?php $this->start('file') ?>
Expand All @@ -36,7 +36,7 @@ Add a matching route to <?= 'config' . DIRECTORY_SEPARATOR . 'routes.php' ?></p>
<?php if (!empty($attributes['context'])): ?>
<p>The passed context was:</p>
<pre>
<?= Debugger::exportVar($attributes['context']); ?>
<?= h(Debugger::exportVar($attributes['context'])); ?>
</pre>
<?php endif; ?>

Expand All @@ -48,9 +48,9 @@ foreach (Router::routes() as $route):
echo '<tr>';
printf(
'<td width="25%%">%s</td><td>%s</td><td width="20%%">%s</td>',
$route->template,
Debugger::exportVar($route->defaults),
Debugger::exportVar($route->options)
h($route->template),
h(Debugger::exportVar($route->defaults)),
h(Debugger::exportVar($route->options))
);
echo '</tr>';
endforeach;
Expand Down

0 comments on commit 1ea0c87

Please sign in to comment.