dompurify 2.5.5 → 2.5.6

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.5.5 | (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.5/LICENSE */
1
+ /*! @license DOMPurify 2.5.6 | (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.6/LICENSE */
2
2
 
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -287,7 +287,7 @@
287
287
  * Version label, exposed for easier checks
288
288
  * if DOMPurify is up to date or not
289
289
  */
290
- DOMPurify.version = '2.5.5';
290
+ DOMPurify.version = '2.5.6';
291
291
 
292
292
  /**
293
293
  * Array of elements that DOMPurify removed during sanitation.
@@ -1149,6 +1149,13 @@
1149
1149
  hookEvent.forceKeepAttr = undefined; // Allows developers to see this is a property they can set
1150
1150
  _executeHook('uponSanitizeAttribute', currentNode, hookEvent);
1151
1151
  value = hookEvent.attrValue;
1152
+
1153
+ /* Work around a security issue with comments inside attributes */
1154
+ if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|title)/i, value)) {
1155
+ _removeAttribute(name, currentNode);
1156
+ continue;
1157
+ }
1158
+
1152
1159
  /* Did the hooks approve of the attribute? */
1153
1160
  if (hookEvent.forceKeepAttr) {
1154
1161
  continue;
@@ -1168,12 +1175,6 @@
1168
1175
  continue;
1169
1176
  }
1170
1177
 
1171
- /* Work around a security issue with comments inside attributes */
1172
- if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|title)/i, value)) {
1173
- _removeAttribute(name, currentNode);
1174
- continue;
1175
- }
1176
-
1177
1178
  /* Sanitize attribute content to be template-safe */
1178
1179
  if (SAFE_FOR_TEMPLATES) {
1179
1180
  value = stringReplace(value, MUSTACHE_EXPR$1, ' ');