Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 90952ba

Browse files
TEST
1 parent 33bb1d1 commit 90952ba

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

src/ng/interpolate.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,6 @@ function $InterpolateProvider() {
334334

335335
return compute(values);
336336
} catch (err) {
337-
console.log(err.stack);
338337
$exceptionHandler($interpolateMinErr.interr(text, err));
339338
}
340339

src/ng/sanitizeUri.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ function $$SanitizeUriProvider() {
6969

7070
this.$get = function() {
7171
return function sanitizeUri(uri, isMediaUrl) {
72+
if (!uri) return uri;
7273
var regex = isMediaUrl ? imgSrcSanitizationWhitelist : aHrefSanitizationWhitelist;
73-
var normalizedVal;
74-
normalizedVal = urlResolve(uri && uri.trim()).href;
74+
var normalizedVal = urlResolve(uri.trim()).href;
7575
if (normalizedVal !== '' && !normalizedVal.match(regex)) {
7676
return 'unsafe:' + normalizedVal;
7777
}

test/ng/compileSpec.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11173,13 +11173,13 @@ describe('$compile', function() {
1117311173
$rootScope.$digest();
1117411174
expect(element.attr('src')).toEqual('unsafe:untrusted:foo();ponies');
1117511175

11176-
element = $compile('<img src="http://{{testUrl}}"></img>')($rootScope);
11177-
$rootScope.testUrl = $sce.trustAsUrl('untrusted:foo();');
11176+
element = $compile('<img src="http://{{testUrl2}}"></img>')($rootScope);
11177+
$rootScope.testUrl2 = $sce.trustAsUrl('xyz;');
1117811178
$rootScope.$digest();
11179-
expect(element.attr('src')).toEqual('http://untrusted:foo();');
11179+
expect(element.attr('src')).toEqual('http://xyz;');
1118011180

11181-
element = $compile('<img src="{{testUrl}}{{testUrl}}"></img>')($rootScope);
11182-
$rootScope.testUrl = $sce.trustAsUrl('untrusted:foo();');
11181+
element = $compile('<img src="{{testUrl3}}{{testUrl3}}"></img>')($rootScope);
11182+
$rootScope.testUrl3 = $sce.trustAsUrl('untrusted:foo();');
1118311183
$rootScope.$digest();
1118411184
expect(element.attr('src')).toEqual('unsafe:untrusted:foo();untrusted:foo();');
1118511185
}));
@@ -11220,7 +11220,7 @@ describe('$compile', function() {
1122011220
expect(element.attr('src')).toEqual('someSanitizedUrl');
1122111221

1122211222
element = $compile('<img src="http://{{testUrl}}"></img>')($rootScope);
11223-
$rootScope.testUrl = $sce.trustAsUrl('javascript:foo();');
11223+
$rootScope.testUrl = $sce.trustAsUrl('xyz');
1122411224
$rootScope.$digest();
1122511225
expect(element.attr('src')).toEqual('someSanitizedUrl');
1122611226
});

0 commit comments

Comments
 (0)