Skip to content

Commit

Permalink
Fix Trusted Types Sink violation with empty input and NAMESPACE
Browse files Browse the repository at this point in the history
  • Loading branch information
tosmolka committed Dec 19, 2022
1 parent 4945074 commit 191cc00
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/purify.js
Original file line number Diff line number Diff line change
Expand Up @@ -844,7 +844,7 @@ function createDOMPurify(window = getGlobal()) {
if (!doc || !doc.documentElement) {
doc = implementation.createDocument(NAMESPACE, 'template', null);
try {
doc.documentElement.innerHTML = IS_EMPTY_INPUT ? '' : dirtyPayload;
doc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload;
} catch (_) {
// Syntax error if dirtyPayload is invalid xml
}
Expand Down

0 comments on commit 191cc00

Please sign in to comment.