mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2026-03-05 13:30:32 -05:00
refactor: use given HTML config for DOMPurify
This commit is contained in:
@@ -812,12 +812,11 @@ jQuery.PrivateBin = (function($) {
|
||||
|
||||
if (containsHtml) {
|
||||
// only allow tags/attributes we actually use in translations
|
||||
output = DOMPurify.sanitize(
|
||||
output, {
|
||||
const sanitizeConfig = Object.assign({}, purifyHtmlConfig, {
|
||||
ALLOWED_TAGS: ['a', 'i', 'span', 'kbd'],
|
||||
ALLOWED_ATTR: ['href', 'id']
|
||||
}
|
||||
);
|
||||
});
|
||||
output = DOMPurify.sanitize(output, sanitizeConfig);
|
||||
}
|
||||
|
||||
// if $element is given, insert translation
|
||||
|
||||
Reference in New Issue
Block a user