Skip to content

Commit

Permalink
fix: strip tags in comments
Browse files Browse the repository at this point in the history
  • Loading branch information
thorsten committed Feb 14, 2023
1 parent ae6c1d8 commit 128ef85
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion phpmyfaq/ajaxservice.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@
->setType($type)
->setUsername($username)
->setEmail($mailer)
->setComment(nl2br($comment))
->setComment(nl2br(strip_tags($comment)))
->setDate($_SERVER['REQUEST_TIME']);

if ($oComment->addComment($commentEntity)) {
Expand Down
2 changes: 1 addition & 1 deletion phpmyfaq/src/phpMyFAQ/Comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function getComments(int $id, string $type): string
$output .= sprintf(
'<strong><a href="mailto:%s">%s</a></strong>',
$mail->safeEmail($item->getEmail()),
$item->getUsername()
Strings::htmlentities($item->getUsername())
);
$output .= sprintf(' <span class="text-muted">(%s)</span>', $date->format($item->getDate()));
$output .= ' </div>';
Expand Down

0 comments on commit 128ef85

Please sign in to comment.