Skip to content

Commit

Permalink
fix: Expanded the comment scrubbing regex matching a bit further
Browse files Browse the repository at this point in the history
  • Loading branch information
cure53 committed May 7, 2024
1 parent b6818ce commit ae517d6
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion dist/purify.cjs.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/purify.cjs.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/purify.es.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1206,7 +1206,7 @@ function createDOMPurify() {
}

/* Work around a security issue with comments inside attributes */
if (SAFE_FOR_XML && regExpTest(/(--!?|])>/i, value)) {
if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/style/i, value)) {
_removeAttribute(name, currentNode);
continue;
}
Expand Down
2 changes: 1 addition & 1 deletion dist/purify.es.mjs.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/purify.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/purify.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/purify.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/purify.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/purify.js
Original file line number Diff line number Diff line change
Expand Up @@ -1312,7 +1312,7 @@ function createDOMPurify(window = getGlobal()) {
}

/* Work around a security issue with comments inside attributes */
if (SAFE_FOR_XML && regExpTest(/(--!?|])>/i, value)) {
if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/style/i, value)) {
_removeAttribute(name, currentNode);
continue;
}
Expand Down

0 comments on commit ae517d6

Please sign in to comment.