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

Commit 3b2c6f0

Browse files
Anders Hessellund Jensenpetebacondarwin
Anders Hessellund Jensen
authored andcommitted
fix($compile): empty normalized href should pass sanitation check
Sometimes IE returns an empty string for its normalized href on a tags. This should pass the sanitation check in $compile. Closes #2219, #2593
1 parent 63414b9 commit 3b2c6f0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ng/compile.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ function $CompileProvider($provide) {
293293

294294
// href property always returns normalized absolute url, so we can match against that
295295
normalizedVal = urlSanitizationNode.href;
296-
if (!normalizedVal.match(urlSanitizationWhitelist)) {
296+
if (normalizedVal !== '' && !normalizedVal.match(urlSanitizationWhitelist)) {
297297
this[key] = value = 'unsafe:' + normalizedVal;
298298
}
299299
}

0 commit comments

Comments
 (0)