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/dist/purify.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! @license DOMPurify 2.3.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.3.9/LICENSE */
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 (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -300,6 +300,9 @@
300
300
  return trustedTypes.createPolicy(policyName, {
301
301
  createHTML: function createHTML(html) {
302
302
  return html;
303
+ },
304
+ createScriptURL: function createScriptURL(scriptUrl) {
305
+ return scriptUrl;
303
306
  }
304
307
  });
305
308
  } catch (_) {
@@ -323,7 +326,7 @@
323
326
  */
324
327
 
325
328
 
326
- DOMPurify.version = '2.3.9';
329
+ DOMPurify.version = '2.3.10';
327
330
  /**
328
331
  * Array of elements that DOMPurify removed during sanitation.
329
332
  * Empty if nothing was removed.
@@ -1253,6 +1256,22 @@
1253
1256
  if (!_isValidAttribute(lcTag, lcName, value)) {
1254
1257
  continue;
1255
1258
  }
1259
+ /* Handle attributes that require Trusted Types */
1260
+
1261
+
1262
+ if (trustedTypesPolicy && _typeof(trustedTypes) === 'object' && typeof trustedTypes.getAttributeType === 'function') {
1263
+ if (namespaceURI) ; else {
1264
+ switch (trustedTypes.getAttributeType(lcTag, lcName)) {
1265
+ case 'TrustedHTML':
1266
+ value = trustedTypesPolicy.createHTML(value);
1267
+ break;
1268
+
1269
+ case 'TrustedScriptURL':
1270
+ value = trustedTypesPolicy.createScriptURL(value);
1271
+ break;
1272
+ }
1273
+ }
1274
+ }
1256
1275
  /* Handle invalid data-* attribute set by try-catching it */
1257
1276
 
1258
1277