mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-08-06 04:37:37 +00:00
Change safeHTML attribute check
This commit is contained in:
@@ -32,12 +32,12 @@ function safeHTML(htmlString) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Check remaining elements for blacklisted attributes
|
// Check remaining elements for blacklisted attributes
|
||||||
for (const attribute of element.attributes){
|
[...element.attributes].forEach((attribute)=>{
|
||||||
if(blacklistAttrs.some((test)=>{return test(attribute);})) {
|
if(blacklistAttrs.some((test)=>{return test(attribute);})) {
|
||||||
element.removeAttribute(attribute.localName);
|
element.removeAttribute(attribute.name);
|
||||||
break;
|
return;
|
||||||
};
|
};
|
||||||
};
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
return div.innerHTML;
|
return div.innerHTML;
|
||||||
|
|||||||
Reference in New Issue
Block a user