Skip to content

Commit

Permalink
fix: corrected HTML sanitizer configuration (#2497)
Browse files Browse the repository at this point in the history
  • Loading branch information
thorsten committed Jun 10, 2023
1 parent ee7fa51 commit 0a904c1
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion phpmyfaq/src/phpMyFAQ/Helper/FaqHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,18 @@ public function createFaqTranslationLinkList(int $faqId, string $faqLang): strin
*/
public function cleanUpContent(string $content): string
{
$htmlSanitizer = Sanitizer::create(['extensions' => ['basic']]);
$htmlSanitizer = Sanitizer::create(
[
'extensions' => [
'basic', 'code', 'image', 'list', 'table', 'iframe', 'details', 'extra'
],
'tags' => [
'img' => [
'allowed_attributes' => ['src', 'alt', 'title', 'class', 'width', 'height'],
],
]
]
);

return $htmlSanitizer->sanitize($content);
}
Expand Down

0 comments on commit 0a904c1

Please sign in to comment.