mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-16 23:30:23 +00:00
fix($compile): whitelist file:// in url sanitization
This commit is contained in:
parent
c36933d38f
commit
7b236b29aa
2 changed files with 5 additions and 1 deletions
|
|
@ -156,7 +156,7 @@ function $CompileProvider($provide) {
|
|||
COMMENT_DIRECTIVE_REGEXP = /^\s*directive\:\s*([\d\w\-_]+)\s+(.*)$/,
|
||||
CLASS_DIRECTIVE_REGEXP = /(([\d\w\-_]+)(?:\:([^;]+))?;?)/,
|
||||
MULTI_ROOT_TEMPLATE_ERROR = 'Template must have exactly one root element. was: ',
|
||||
urlSanitizationWhitelist = /^\s*(https?|ftp|mailto):/;
|
||||
urlSanitizationWhitelist = /^\s*(https?|ftp|mailto|file):/;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -2479,6 +2479,10 @@ describe('$compile', function() {
|
|||
$rootScope.testUrl = "mailto:foo@bar.com";
|
||||
$rootScope.$apply();
|
||||
expect(element.attr('href')).toBe('mailto:foo@bar.com');
|
||||
|
||||
$rootScope.testUrl = "file:///foo/bar.html";
|
||||
$rootScope.$apply();
|
||||
expect(element.attr('href')).toBe('file:///foo/bar.html');
|
||||
}));
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue