run comment through htmlspecialchars() if markdown parsing is enabled

This commit is contained in:
Uwe Steinmann 2023-04-22 19:41:41 +02:00
parent 511492fb5c
commit 28174e3a33

View File

@ -421,7 +421,7 @@ $(document).ready( function() {
if($document->getComment()) {
if($settings->_markdownComments) {
$Parsedown = new Parsedown();
$comment = $Parsedown->text($document->getComment());
$comment = $Parsedown->text(htmlspecialchars($document->getComment()));
} else {
$comment = htmlspecialchars($document->getComment());
}
@ -773,7 +773,7 @@ $(document).ready( function() {
if($latestContent->getComment())
if($settings->_markdownComments) {
$Parsedown = new Parsedown();
$comment = $Parsedown->text($latestContent->getComment());
$comment = $Parsedown->text(htmlspecialchars($latestContent->getComment()));
print "<div class=\"content-comment\">".$comment."</div>";
} else {
$comment = htmlspecialchars($latestContent->getComment());