dompurify 2.4.8 → 2.4.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/README.md +1 -1
- package/dist/purify.cjs.js +12 -4
- package/dist/purify.cjs.js.map +1 -1
- package/dist/purify.es.js +12 -4
- package/dist/purify.es.js.map +1 -1
- package/dist/purify.js +12 -4
- 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/README.md
CHANGED
|
@@ -10,7 +10,7 @@ It's also very simple to use and get started with. DOMPurify was [started in Feb
|
|
|
10
10
|
|
|
11
11
|
DOMPurify is written in JavaScript and works in all modern browsers (Safari (10+), Opera (15+), Internet Explorer (10+), Edge, Firefox and Chrome - as well as almost anything else using Blink or WebKit). It doesn't break on MSIE6 or other legacy browsers. It either uses [a fall-back](#what-about-older-browsers-like-msie8) or simply does nothing.
|
|
12
12
|
|
|
13
|
-
**Note that DOMPurify v2.4.
|
|
13
|
+
**Note that DOMPurify v2.4.9 is the latest version supporting MSIE. For important security updates compatible with MSIE, please use the 2.x branch.**
|
|
14
14
|
|
|
15
15
|
Our automated tests cover [19 different browsers](https://github.com/cure53/DOMPurify/blob/main/test/karma.custom-launchers.config.js#L5) right now, more to come. We also cover Node.js v14.x, v16.x, v17.x and v18.x, running DOMPurify on [jsdom](https://github.com/jsdom/jsdom). Older Node versions are known to work as well, but hey... no guarantees.
|
|
16
16
|
|
package/dist/purify.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @license DOMPurify 2.4.
|
|
1
|
+
/*! @license DOMPurify 2.4.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.4.9/LICENSE */
|
|
2
2
|
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
@@ -265,7 +265,7 @@ var IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i);
|
|
|
265
265
|
var ATTR_WHITESPACE = seal(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g // eslint-disable-line no-control-regex
|
|
266
266
|
);
|
|
267
267
|
var DOCTYPE_NAME = seal(/^html$/i);
|
|
268
|
-
var CUSTOM_ELEMENT = seal(/^[a-z][
|
|
268
|
+
var CUSTOM_ELEMENT = seal(/^[a-z][.\w]*(-[.\w]+)+$/i);
|
|
269
269
|
|
|
270
270
|
var getGlobal = function getGlobal() {
|
|
271
271
|
return typeof window === 'undefined' ? null : window;
|
|
@@ -327,7 +327,7 @@ function createDOMPurify() {
|
|
|
327
327
|
*/
|
|
328
328
|
|
|
329
329
|
|
|
330
|
-
DOMPurify.version = '2.4.
|
|
330
|
+
DOMPurify.version = '2.4.9';
|
|
331
331
|
/**
|
|
332
332
|
* Array of elements that DOMPurify removed during sanitation.
|
|
333
333
|
* Empty if nothing was removed.
|
|
@@ -989,7 +989,7 @@ function createDOMPurify() {
|
|
|
989
989
|
|
|
990
990
|
var _createIterator = function _createIterator(root) {
|
|
991
991
|
return createNodeIterator.call(root.ownerDocument || root, root, // eslint-disable-next-line no-bitwise
|
|
992
|
-
NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION, null, false);
|
|
992
|
+
NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION, null, false);
|
|
993
993
|
};
|
|
994
994
|
/**
|
|
995
995
|
* _isClobbered
|
|
@@ -1091,6 +1091,14 @@ function createDOMPurify() {
|
|
|
1091
1091
|
|
|
1092
1092
|
return true;
|
|
1093
1093
|
}
|
|
1094
|
+
/* Remove any ocurrence of processing instructions */
|
|
1095
|
+
|
|
1096
|
+
|
|
1097
|
+
if (currentNode.nodeType === 7) {
|
|
1098
|
+
_forceRemove(currentNode);
|
|
1099
|
+
|
|
1100
|
+
return true;
|
|
1101
|
+
}
|
|
1094
1102
|
/* Remove element if anything forbids its presence */
|
|
1095
1103
|
|
|
1096
1104
|
|