Skip to content

Commit ce97b52

Browse files
authored
Merge pull request #28 from kdambekalns/task/drop-deprecated-filter-types
Drop deprecated FILTER_SANITIZE_STRIPPED type
2 parents c44f619 + 5b695a5 commit ce97b52

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Classes/Controller/CommentController.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ public function createAction(NodeInterface $postNode = null, NodeTemplate $newCo
7070
$this->throwStatus(400, 'Your comment was NOT created - it was too short.');
7171
}
7272

73-
$newComment->setProperty('text', filter_var($newComment->getProperty('text'), FILTER_SANITIZE_STRIPPED));
74-
$newComment->setProperty('author', filter_var($newComment->getProperty('author'), FILTER_SANITIZE_STRIPPED));
75-
$newComment->setProperty('emailAddress', filter_var($newComment->getProperty('emailAddress'), FILTER_SANITIZE_STRIPPED));
73+
$newComment->setProperty('text', htmlspecialchars($newComment->getProperty('text')));
74+
$newComment->setProperty('author', htmlspecialchars($newComment->getProperty('author')));
75+
$newComment->setProperty('emailAddress', htmlspecialchars($newComment->getProperty('emailAddress')));
7676

7777
$commentNode = $postNode->getNode('comments')->createNodeFromTemplate($newComment, uniqid('comment-', true));
7878
$commentNode->setProperty('spam', false);

0 commit comments

Comments
 (0)