Skip to content

Commit

Permalink
fix: strip tags for questions and answers
Browse files Browse the repository at this point in the history
  • Loading branch information
thorsten committed Jan 25, 2023
1 parent f34d84d commit 40515c7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions phpmyfaq/ajaxservice.php
Expand Up @@ -322,11 +322,13 @@
$faqId = Filter::filterInput(INPUT_POST, 'faqid', FILTER_VALIDATE_INT);
$faqLanguage = Filter::filterInput(INPUT_POST, 'lang', FILTER_UNSAFE_RAW);
$question = Filter::filterInput(INPUT_POST, 'question', FILTER_UNSAFE_RAW);
$question = strip_tags($question);
if ($faqConfig->get('main.enableWysiwygEditorFrontend')) {
$answer = Filter::filterInput(INPUT_POST, 'answer', FILTER_SANITIZE_SPECIAL_CHARS);
$answer = html_entity_decode($answer);
} else {
$answer = Filter::filterInput(INPUT_POST, 'answer', FILTER_UNSAFE_RAW);
$answer = strip_tags($answer);
$answer = nl2br($answer);
}
$translatedAnswer = Filter::filterInput(INPUT_POST, 'translated_answer', FILTER_UNSAFE_RAW);
Expand Down

0 comments on commit 40515c7

Please sign in to comment.