Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Commit be0446f

Browse files
committed
webui: Update AngularJS to v1.8.2
1 parent 1cb43f6 commit be0446f

12 files changed

+736
-588
lines changed

webui/js/angular-1.7.9.min.js

Lines changed: 0 additions & 350 deletions
This file was deleted.

webui/js/angular-1.7.9.min.js.map

Lines changed: 0 additions & 8 deletions
This file was deleted.

webui/js/angular-1.7.9.js renamed to webui/js/angular-1.8.2.js

Lines changed: 325 additions & 156 deletions
Large diffs are not rendered by default.

webui/js/angular-1.8.2.min.js

Lines changed: 352 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webui/js/angular-1.8.2.min.js.map

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webui/js/angular-sanitize-1.7.9.min.js

Lines changed: 0 additions & 18 deletions
This file was deleted.

webui/js/angular-sanitize-1.7.9.js renamed to webui/js/angular-sanitize-1.8.2.js

Lines changed: 21 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
2-
* @license AngularJS v1.7.9
3-
* (c) 2010-2018 Google, Inc. http://angularjs.org
2+
* @license AngularJS v1.8.2
3+
* (c) 2010-2020 Google LLC. http://angularjs.org
44
* License: MIT
55
*/
66
(function(window, angular) {'use strict';
@@ -46,12 +46,12 @@ var htmlSanitizeWriter;
4646
* @description
4747
* Sanitizes an html string by stripping all potentially dangerous tokens.
4848
*
49-
* The input is sanitized by parsing the HTML into tokens. All safe tokens (from a whitelist) are
49+
* The input is sanitized by parsing the HTML into tokens. All safe tokens (from a trusted URI list) are
5050
* then serialized back to a properly escaped HTML string. This means that no unsafe input can make
5151
* it into the returned string.
5252
*
53-
* The whitelist for URL sanitization of attribute values is configured using the functions
54-
* `aHrefSanitizationWhitelist` and `imgSrcSanitizationWhitelist` of {@link $compileProvider}.
53+
* The trusted URIs for URL sanitization of attribute values is configured using the functions
54+
* `aHrefSanitizationTrustedUrlList` and `imgSrcSanitizationTrustedUrlList` of {@link $compileProvider}.
5555
*
5656
* The input may also contain SVG markup if this is enabled via {@link $sanitizeProvider}.
5757
*
@@ -282,8 +282,8 @@ function $SanitizeProvider() {
282282
* **Note**:
283283
* The new attributes will not be treated as URI attributes, which means their values will not be
284284
* sanitized as URIs using `$compileProvider`'s
285-
* {@link ng.$compileProvider#aHrefSanitizationWhitelist aHrefSanitizationWhitelist} and
286-
* {@link ng.$compileProvider#imgSrcSanitizationWhitelist imgSrcSanitizationWhitelist}.
285+
* {@link ng.$compileProvider#aHrefSanitizationTrustedUrlList aHrefSanitizationTrustedUrlList} and
286+
* {@link ng.$compileProvider#imgSrcSanitizationTrustedUrlList imgSrcSanitizationTrustedUrlList}.
287287
*
288288
* <div class="alert alert-info">
289289
* This method must be called during the {@link angular.Module#config config} phase. Once the
@@ -426,50 +426,28 @@ function $SanitizeProvider() {
426426
}
427427

428428
/**
429-
* Create an inert document that contains the dirty HTML that needs sanitizing
430-
* Depending upon browser support we use one of three strategies for doing this.
431-
* Support: Safari 10.x -> XHR strategy
432-
* Support: Firefox -> DomParser strategy
429+
* Create an inert document that contains the dirty HTML that needs sanitizing.
430+
* We use the DOMParser API by default and fall back to createHTMLDocument if DOMParser is not
431+
* available.
433432
*/
434433
var getInertBodyElement /* function(html: string): HTMLBodyElement */ = (function(window, document) {
435-
var inertDocument;
436-
if (document && document.implementation) {
437-
inertDocument = document.implementation.createHTMLDocument('inert');
438-
} else {
439-
throw $sanitizeMinErr('noinert', 'Can\'t create an inert html document');
434+
if (isDOMParserAvailable()) {
435+
return getInertBodyElement_DOMParser;
440436
}
441-
var inertBodyElement = (inertDocument.documentElement || inertDocument.getDocumentElement()).querySelector('body');
442437

443-
// Check for the Safari 10.1 bug - which allows JS to run inside the SVG G element
444-
inertBodyElement.innerHTML = '<svg><g onload="this.parentNode.remove()"></g></svg>';
445-
if (!inertBodyElement.querySelector('svg')) {
446-
return getInertBodyElement_XHR;
447-
} else {
448-
// Check for the Firefox bug - which prevents the inner img JS from being sanitized
449-
inertBodyElement.innerHTML = '<svg><p><style><img src="</style><img src=x onerror=alert(1)//">';
450-
if (inertBodyElement.querySelector('svg img')) {
451-
return getInertBodyElement_DOMParser;
452-
} else {
453-
return getInertBodyElement_InertDocument;
454-
}
438+
if (!document || !document.implementation) {
439+
throw $sanitizeMinErr('noinert', 'Can\'t create an inert html document');
455440
}
441+
var inertDocument = document.implementation.createHTMLDocument('inert');
442+
var inertBodyElement = (inertDocument.documentElement || inertDocument.getDocumentElement()).querySelector('body');
443+
return getInertBodyElement_InertDocument;
456444

457-
function getInertBodyElement_XHR(html) {
458-
// We add this dummy element to ensure that the rest of the content is parsed as expected
459-
// e.g. leading whitespace is maintained and tags like `<meta>` do not get hoisted to the `<head>` tag.
460-
html = '<remove></remove>' + html;
445+
function isDOMParserAvailable() {
461446
try {
462-
html = encodeURI(html);
447+
return !!getInertBodyElement_DOMParser('');
463448
} catch (e) {
464-
return undefined;
449+
return false;
465450
}
466-
var xhr = new window.XMLHttpRequest();
467-
xhr.responseType = 'document';
468-
xhr.open('GET', 'data:text/html;charset=utf-8,' + html, false);
469-
xhr.send(null);
470-
var body = xhr.response.body;
471-
body.firstChild.remove();
472-
return body;
473451
}
474452

475453
function getInertBodyElement_DOMParser(html) {
@@ -711,7 +689,7 @@ function sanitizeText(chars) {
711689
// define ngSanitize module and register $sanitize service
712690
angular.module('ngSanitize', [])
713691
.provider('$sanitize', $SanitizeProvider)
714-
.info({ angularVersion: '1.7.9' });
692+
.info({ angularVersion: '1.8.2' });
715693

716694
/**
717695
* @ngdoc filter

webui/js/angular-sanitize-1.8.2.min.js

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)