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
This commit is contained in:
Anders Hessellund Jensen 2013-05-06 22:18:42 +02:00 committed by Pete Bacon Darwin
parent 63414b9653
commit 3b2c6f09cb

View file

@ -293,7 +293,7 @@ function $CompileProvider($provide) {
// href property always returns normalized absolute url, so we can match against that
normalizedVal = urlSanitizationNode.href;
if (!normalizedVal.match(urlSanitizationWhitelist)) {
if (normalizedVal !== '' && !normalizedVal.match(urlSanitizationWhitelist)) {
this[key] = value = 'unsafe:' + normalizedVal;
}
}