Skip to content

Commit

Permalink
refactor: sanitize record name before output.
Browse files Browse the repository at this point in the history
  • Loading branch information
edmondas committed Dec 2, 2023
1 parent 71a55d4 commit ecda6cb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/Application/Presenter/ErrorPresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ private function sanitizeMessage(string $message): string

private function renderError(string $msg, ?string $name): void
{
$errorContent = ($name !== null) ? "$msg (Record: $name)" : $msg;
$safeName = htmlspecialchars($name, ENT_QUOTES, 'UTF-8');
$errorContent = ($name !== null) ? "$msg (Record: $safeName)" : $msg;

echo <<<HTML
<div class="alert alert-danger">
Expand Down

0 comments on commit ecda6cb

Please sign in to comment.