Skip to content

Commit

Permalink
Fix remaining lint issues from upstream/master
Browse files Browse the repository at this point in the history
  • Loading branch information
tdeekens committed May 19, 2017
1 parent 533efd5 commit 00bfb8a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
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 package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"scripts": {
"build-demo": "node scripts/build-demo.js",
"lint": "xo src/*.js",
"format": "prettier --write --trailing-comma all --single-quote 'src/*.js'",
"format": "prettier --write --trailing-comma es5 --single-quote 'src/*.js'",
"amend-build": "scripts/amend-build.sh",
"prebuild": "rimraf dist/**",
"build": "npm run build:umd && npm run build:umd:min",
Expand Down
10 changes: 5 additions & 5 deletions src/purify.js
Original file line number Diff line number Diff line change
Expand Up @@ -326,8 +326,8 @@ function createDOMPurify(window = getGlobal()) {
if (useXHR) {
try {
dirty = encodeURI(dirty);
} catch (e) {}
var xhr = new XMLHttpRequest();
} catch (err) {}
const xhr = new XMLHttpRequest();
xhr.responseType = 'document';
xhr.open('GET', 'data:text/html;charset=utf-8,' + dirty, false);
xhr.send(null);
Expand Down Expand Up @@ -375,13 +375,13 @@ function createDOMPurify(window = getGlobal()) {
if (DOMPurify.isSupported) {
(function() {
let doc = _initDocument(
'<svg><g onload="this.parentNode.remove()"></g></svg>',
'<svg><g onload="this.parentNode.remove()"></g></svg>'
);
if (!doc.querySelector('svg')) {
useXHR = true;
}
doc = _initDocument(
'<svg><p><style><img src="</style><img src=x onerror=alert(1)//">',
'<svg><p><style><img src="</style><img src=x onerror=alert(1)//">'
);
if (doc.querySelector('svg img')) {
useDOMParser = true;
Expand All @@ -403,7 +403,7 @@ function createDOMPurify(window = getGlobal()) {
() => {
return NodeFilter.FILTER_ACCEPT;
},
false,
false
);
};

Expand Down

0 comments on commit 00bfb8a

Please sign in to comment.