Skip to content

Commit a91dde9

Browse files
committed
pkp#7916 Applied html_entity_decode to return sanitized value
1 parent 65228a9 commit a91dde9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

classes/core/PKPString.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -458,10 +458,10 @@ public static function stripUnsafeHtml(?string $input, string $key = 'allowed_ht
458458
$sanitizer = new HtmlSanitizer($config);
459459
}
460460

461-
return $sanitizer->sanitize(
462-
strip_tags(
463-
$input,
464-
$allowedTagToAttributeMap->keys()->toArray()
461+
// need to apply html_entity_decode as sanitizer apply htmlentities internally for special chars
462+
return html_entity_decode(
463+
$sanitizer->sanitize(
464+
strip_tags($input, $allowedTagToAttributeMap->keys()->toArray())
465465
)
466466
);
467467
}

0 commit comments

Comments
 (0)