dompurify 2.5.7 → 2.5.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +5 -3
- package/dist/purify.cjs.js +13 -18
- package/dist/purify.cjs.js.map +1 -1
- package/dist/purify.es.js +13 -18
- package/dist/purify.es.js.map +1 -1
- package/dist/purify.js +13 -18
- package/dist/purify.js.map +1 -1
- package/dist/purify.min.js +2 -2
- package/dist/purify.min.js.map +1 -1
- package/package.json +1 -1
package/dist/purify.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @license DOMPurify 2.5.
|
|
1
|
+
/*! @license DOMPurify 2.5.9 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.5.9/LICENSE */
|
|
2
2
|
|
|
3
3
|
function _typeof(obj) {
|
|
4
4
|
"@babel/helpers - typeof";
|
|
@@ -218,7 +218,7 @@ var xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xli
|
|
|
218
218
|
var MUSTACHE_EXPR = seal(/\{\{[\w\W]*|[\w\W]*\}\}/gm); // Specify template detection regex for SAFE_FOR_TEMPLATES mode
|
|
219
219
|
var ERB_EXPR = seal(/<%[\w\W]*|[\w\W]*%>/gm);
|
|
220
220
|
var TMPLIT_EXPR = seal(/\${[\w\W]*}/gm);
|
|
221
|
-
var DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]
|
|
221
|
+
var DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]+$/); // eslint-disable-line no-useless-escape
|
|
222
222
|
var ARIA_ATTR = seal(/^aria-[\-\w]+$/); // eslint-disable-line no-useless-escape
|
|
223
223
|
var IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i // eslint-disable-line no-useless-escape
|
|
224
224
|
);
|
|
@@ -281,7 +281,7 @@ function createDOMPurify() {
|
|
|
281
281
|
* Version label, exposed for easier checks
|
|
282
282
|
* if DOMPurify is up to date or not
|
|
283
283
|
*/
|
|
284
|
-
DOMPurify.version = '2.5.
|
|
284
|
+
DOMPurify.version = '2.5.9';
|
|
285
285
|
|
|
286
286
|
/**
|
|
287
287
|
* Array of elements that DOMPurify removed during sanitation.
|
|
@@ -1116,7 +1116,7 @@ function createDOMPurify() {
|
|
|
1116
1116
|
var attributes = currentNode.attributes;
|
|
1117
1117
|
|
|
1118
1118
|
/* Check if we have attributes; if not we might have a text node */
|
|
1119
|
-
if (!attributes) {
|
|
1119
|
+
if (!attributes || _isClobbered(currentNode)) {
|
|
1120
1120
|
return;
|
|
1121
1121
|
}
|
|
1122
1122
|
var hookEvent = {
|
|
@@ -1188,7 +1188,7 @@ function createDOMPurify() {
|
|
|
1188
1188
|
}
|
|
1189
1189
|
|
|
1190
1190
|
/* Work around a security issue with comments inside attributes */
|
|
1191
|
-
if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|title)/i, value)) {
|
|
1191
|
+
if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, value)) {
|
|
1192
1192
|
_removeAttribute(name, currentNode);
|
|
1193
1193
|
continue;
|
|
1194
1194
|
}
|
|
@@ -1245,19 +1245,16 @@ function createDOMPurify() {
|
|
|
1245
1245
|
while (shadowNode = shadowIterator.nextNode()) {
|
|
1246
1246
|
/* Execute a hook if present */
|
|
1247
1247
|
_executeHook('uponSanitizeShadowNode', shadowNode, null);
|
|
1248
|
-
|
|
1249
1248
|
/* Sanitize tags and elements */
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1249
|
+
_sanitizeElements(shadowNode);
|
|
1250
|
+
|
|
1251
|
+
/* Check attributes next */
|
|
1252
|
+
_sanitizeAttributes(shadowNode);
|
|
1253
1253
|
|
|
1254
1254
|
/* Deep shadow DOM detected */
|
|
1255
1255
|
if (shadowNode.content instanceof DocumentFragment) {
|
|
1256
1256
|
_sanitizeShadowDOM(shadowNode.content);
|
|
1257
1257
|
}
|
|
1258
|
-
|
|
1259
|
-
/* Check attributes, sanitize if necessary */
|
|
1260
|
-
_sanitizeAttributes(shadowNode);
|
|
1261
1258
|
}
|
|
1262
1259
|
|
|
1263
1260
|
/* Execute a hook if present */
|
|
@@ -1379,17 +1376,15 @@ function createDOMPurify() {
|
|
|
1379
1376
|
}
|
|
1380
1377
|
|
|
1381
1378
|
/* Sanitize tags and elements */
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1379
|
+
_sanitizeElements(currentNode);
|
|
1380
|
+
|
|
1381
|
+
/* Check attributes next */
|
|
1382
|
+
_sanitizeAttributes(currentNode);
|
|
1385
1383
|
|
|
1386
1384
|
/* Shadow DOM detected, sanitize it */
|
|
1387
1385
|
if (currentNode.content instanceof DocumentFragment) {
|
|
1388
1386
|
_sanitizeShadowDOM(currentNode.content);
|
|
1389
1387
|
}
|
|
1390
|
-
|
|
1391
|
-
/* Check attributes, sanitize if necessary */
|
|
1392
|
-
_sanitizeAttributes(currentNode);
|
|
1393
1388
|
oldNode = currentNode;
|
|
1394
1389
|
}
|
|
1395
1390
|
oldNode = null;
|