Ensure node is an Element in DOMPurify hook

This commit is contained in:
Cohee
2025-02-17 20:54:11 +02:00
parent 277fc00f38
commit ce67f3a658

View File

@@ -366,6 +366,10 @@ DOMPurify.addHook('uponSanitizeElement', (node, _, config) => {
return; return;
} }
if (!(node instanceof Element)) {
return;
}
let mediaBlocked = false; let mediaBlocked = false;
switch (node.tagName) { switch (node.tagName) {