dompurify 2.3.9 → 2.3.10
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/README.md +1 -1
- package/dist/purify.cjs.js +21 -2
- package/dist/purify.cjs.js.map +1 -1
- package/dist/purify.es.js +21 -2
- package/dist/purify.es.js.map +1 -1
- package/dist/purify.js +21 -2
- 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.3.
|
|
1
|
+
/*! @license DOMPurify 2.3.10 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.3.10/LICENSE */
|
|
2
2
|
|
|
3
3
|
function _typeof(obj) {
|
|
4
4
|
"@babel/helpers - typeof";
|
|
@@ -294,6 +294,9 @@ var _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes,
|
|
|
294
294
|
return trustedTypes.createPolicy(policyName, {
|
|
295
295
|
createHTML: function createHTML(html) {
|
|
296
296
|
return html;
|
|
297
|
+
},
|
|
298
|
+
createScriptURL: function createScriptURL(scriptUrl) {
|
|
299
|
+
return scriptUrl;
|
|
297
300
|
}
|
|
298
301
|
});
|
|
299
302
|
} catch (_) {
|
|
@@ -317,7 +320,7 @@ function createDOMPurify() {
|
|
|
317
320
|
*/
|
|
318
321
|
|
|
319
322
|
|
|
320
|
-
DOMPurify.version = '2.3.
|
|
323
|
+
DOMPurify.version = '2.3.10';
|
|
321
324
|
/**
|
|
322
325
|
* Array of elements that DOMPurify removed during sanitation.
|
|
323
326
|
* Empty if nothing was removed.
|
|
@@ -1247,6 +1250,22 @@ function createDOMPurify() {
|
|
|
1247
1250
|
if (!_isValidAttribute(lcTag, lcName, value)) {
|
|
1248
1251
|
continue;
|
|
1249
1252
|
}
|
|
1253
|
+
/* Handle attributes that require Trusted Types */
|
|
1254
|
+
|
|
1255
|
+
|
|
1256
|
+
if (trustedTypesPolicy && _typeof(trustedTypes) === 'object' && typeof trustedTypes.getAttributeType === 'function') {
|
|
1257
|
+
if (namespaceURI) ; else {
|
|
1258
|
+
switch (trustedTypes.getAttributeType(lcTag, lcName)) {
|
|
1259
|
+
case 'TrustedHTML':
|
|
1260
|
+
value = trustedTypesPolicy.createHTML(value);
|
|
1261
|
+
break;
|
|
1262
|
+
|
|
1263
|
+
case 'TrustedScriptURL':
|
|
1264
|
+
value = trustedTypesPolicy.createScriptURL(value);
|
|
1265
|
+
break;
|
|
1266
|
+
}
|
|
1267
|
+
}
|
|
1268
|
+
}
|
|
1250
1269
|
/* Handle invalid data-* attribute set by try-catching it */
|
|
1251
1270
|
|
|
1252
1271
|
|