
committed by
Alex Rickabaugh

parent
e5e5c24d48
commit
5cf82f8f3f
@ -141,13 +141,13 @@ class SanitizingHtmlSerializer {
|
||||
const elAttrs = element.attributes;
|
||||
for (let i = 0; i < elAttrs.length; i++) {
|
||||
const elAttr = elAttrs.item(i);
|
||||
const attrName = elAttr.name;
|
||||
const attrName = elAttr !.name;
|
||||
const lower = attrName.toLowerCase();
|
||||
if (!VALID_ATTRS.hasOwnProperty(lower)) {
|
||||
this.sanitizedSomething = true;
|
||||
continue;
|
||||
}
|
||||
let value = elAttr.value;
|
||||
let value = elAttr !.value;
|
||||
// TODO(martinprobst): Special case image URIs for data:image/...
|
||||
if (URI_ATTRS[lower]) value = _sanitizeUrl(value);
|
||||
if (SRCSET_ATTRS[lower]) value = sanitizeSrcset(value);
|
||||
|
@ -146,7 +146,7 @@ export class InertBodyHelper {
|
||||
// loop backwards so that we can support removals.
|
||||
for (let i = elAttrs.length - 1; 0 < i; i--) {
|
||||
const attrib = elAttrs.item(i);
|
||||
const attrName = attrib.name;
|
||||
const attrName = attrib !.name;
|
||||
if (attrName === 'xmlns:ns1' || attrName.indexOf('ns1:') === 0) {
|
||||
el.removeAttribute(attrName);
|
||||
}
|
||||
|
Reference in New Issue
Block a user