update sanitizer

This commit is contained in:
zefie
2022-11-30 14:23:11 -05:00
parent d8e9496296
commit 5c74ea22ec

View File

@@ -253,14 +253,15 @@ class WTVShared {
self.debug("sanitizeSignature", "allowed protocols:", allowedProtocols); self.debug("sanitizeSignature", "allowed protocols:", allowedProtocols);
const clean = this.sanitizeHtml(string, { const clean = this.sanitizeHtml(string, {
allowedTags: ['a', 'audioscope', 'b', 'bgsound', 'big', 'blackface', 'blockquote', 'bq', 'br', 'caption', 'center', 'cite', 'c', 'dd', 'dfn', 'div', 'dl', 'dt', 'fn', 'font', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'html', 'i', 'img', 'label', 'li', 'link', 'listing', 'em', 'marquee', 'nobr', 'note', 'ol', 'p', 'plaintext', 'pre', 's', 'samp', 'small', 'span', 'strike', 'strong', 'sub', 'sup', 'tbody', 'table', 'td', 'th', 'tr', 'tt', 'u', 'ul'], allowedTags: ['a', 'audioscope', 'b', 'bgsound', 'big', 'blackface', 'blockquote', 'bq', 'br', 'caption', 'center', 'cite', 'c', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'fn', 'font', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'html', 'i', 'img', 'label', 'li', 'listing', 'marquee', 'nobr', 'ol', 'p', 'plaintext', 'pre', 's', 'samp', 'small', 'shadow', 'span', 'strike', 'strong', 'sub', 'sup', 'tbody', 'table', 'td', 'th', 'tr', 'tt', 'u', 'ul'],
disallowedTagsMode: 'discard', disallowedTagsMode: 'discard',
allowedAttributes: { allowedAttributes: {
a: ['href', 'name', 'target'], a: ['href', 'name', 'target'],
img: ['src', 'alt', 'title', 'width', 'height', 'loading'], audioscope: ['align', 'bgcolor', 'border', 'gain', 'height', 'leftcolor', 'leftoffset', 'maxlevel', 'rightcolor', 'rightoffset', 'width' ],
bgsound: ['src', 'loop'], bgsound: ['src', 'loop'],
img: ['src', 'alt', 'title', 'width', 'height', 'loading'],
font: ['size', 'name', 'color'], font: ['size', 'name', 'color'],
marquee: ['speed'], marquee: ['aign', 'behavior', 'direction', 'height', 'hspace', 'loop', 'scrollamount', 'scrolldelay', 'transparency', 'vspace', 'width'],
}, },
allowedSchemes: allowedSchemes, allowedSchemes: allowedSchemes,
allowedSchemesByTag: {}, allowedSchemesByTag: {},