mirror of
https://github.com/bunkerity/bunkerweb
synced 2026-05-24 09:28:37 +00:00
Update DOMPurify to version 3.0.10 in web UI
This commit is contained in:
parent
e257ececf7
commit
ab921f06e1
4 changed files with 10 additions and 4 deletions
4
src/ui/static/js/utils/purify/purify.min.js
vendored
4
src/ui/static/js/utils/purify/purify.min.js
vendored
File diff suppressed because one or more lines are too long
1
src/ui/static/js/utils/purify/src/license_header
vendored
Normal file
1
src/ui/static/js/utils/purify/src/license_header
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
/*! @license DOMPurify VERSION | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/VERSION/LICENSE */
|
||||
8
src/ui/static/js/utils/purify/src/purify.js
vendored
8
src/ui/static/js/utils/purify/src/purify.js
vendored
|
|
@ -162,6 +162,7 @@ function createDOMPurify(window = getGlobal()) {
|
|||
ARIA_ATTR,
|
||||
IS_SCRIPT_OR_DATA,
|
||||
ATTR_WHITESPACE,
|
||||
CUSTOM_ELEMENT,
|
||||
} = EXPRESSIONS;
|
||||
|
||||
let { IS_ALLOWED_URI } = EXPRESSIONS;
|
||||
|
|
@ -909,7 +910,10 @@ function createDOMPurify(window = getGlobal()) {
|
|||
root.ownerDocument || root,
|
||||
root,
|
||||
// eslint-disable-next-line no-bitwise
|
||||
NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT,
|
||||
NodeFilter.SHOW_ELEMENT |
|
||||
NodeFilter.SHOW_COMMENT |
|
||||
NodeFilter.SHOW_TEXT |
|
||||
NodeFilter.SHOW_PROCESSING_INSTRUCTION,
|
||||
null
|
||||
);
|
||||
};
|
||||
|
|
@ -1189,7 +1193,7 @@ function createDOMPurify(window = getGlobal()) {
|
|||
* @returns {boolean} Returns true if the tag name meets the basic criteria for a custom element, otherwise false.
|
||||
*/
|
||||
const _isBasicCustomElement = function (tagName) {
|
||||
return tagName !== 'annotation-xml' && tagName.indexOf('-') > 0;
|
||||
return tagName !== 'annotation-xml' && stringMatch(tagName, CUSTOM_ELEMENT);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
1
src/ui/static/js/utils/purify/src/regexp.js
vendored
1
src/ui/static/js/utils/purify/src/regexp.js
vendored
|
|
@ -14,3 +14,4 @@ export const ATTR_WHITESPACE = seal(
|
|||
/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g // eslint-disable-line no-control-regex
|
||||
);
|
||||
export const DOCTYPE_NAME = seal(/^html$/i);
|
||||
export const CUSTOM_ELEMENT = seal(/^[a-z][a-z\d]*(-[a-z\d]+)+$/i);
|
||||
|
|
|
|||
Loading…
Reference in a new issue