Skip to content

Commit

Permalink
fix($compile): empty normalized href should pass sanitation check
Browse files Browse the repository at this point in the history
Sometimes IE returns an empty string for its normalized href on a tags.
This should pass the sanitation check in $compile.

Closes angular#2219, angular#2593
  • Loading branch information
Anders Hessellund Jensen authored and petebacondarwin committed Jul 3, 2013
1 parent a59a5f3 commit fc8c9ba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ng/compile.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,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;
}
}
Expand Down

0 comments on commit fc8c9ba

Please sign in to comment.