Skip to content

Commit

Permalink
#7916 Applied html_entity_decode to return sanitized value
Browse files Browse the repository at this point in the history
  • Loading branch information
touhidurabir committed Jun 19, 2023
1 parent 9574ae8 commit fd9be0c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions classes/core/PKPString.php
Original file line number Diff line number Diff line change
Expand Up @@ -458,10 +458,10 @@ public static function stripUnsafeHtml(?string $input, string $key = 'allowed_ht
$sanitizer = new HtmlSanitizer($config);
}

return $sanitizer->sanitize(
strip_tags(
$input,
$allowedTagToAttributeMap->keys()->toArray()
// need to apply html_entity_decode as sanitizer apply htmlentities internally for special chars
return html_entity_decode(
$sanitizer->sanitize(
strip_tags($input, $allowedTagToAttributeMap->keys()->toArray())
)
);
}
Expand Down

0 comments on commit fd9be0c

Please sign in to comment.