Skip to content

Commit 23ff095

Browse files
committed
Minor performance improvements
1 parent e5931be commit 23ff095

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/purify.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -897,7 +897,7 @@ function createDOMPurify(window = getGlobal()) {
897897
}
898898

899899
/* Check if tagname contains Unicode */
900-
if (stringMatch(currentNode.nodeName, /[\u0080-\uFFFF]/)) {
900+
if (regExpTest(/[\u0080-\uFFFF]/, currentNode.nodeName)) {
901901
_forceRemove(currentNode);
902902
return true;
903903
}
@@ -913,6 +913,7 @@ function createDOMPurify(window = getGlobal()) {
913913

914914
/* Detect mXSS attempts abusing namespace confusion */
915915
if (
916+
currentNode.hasChildNodes() &&
916917
!_isNode(currentNode.firstElementChild) &&
917918
(!_isNode(currentNode.content) ||
918919
!_isNode(currentNode.content.firstElementChild)) &&

0 commit comments

Comments
 (0)