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

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 #2219, #2593
  • Loading branch information
Anders Hessellund Jensen authored and petebacondarwin committed Jul 3, 2013
1 parent 63414b9 commit 3b2c6f0
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 @@ -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;
}
}
Expand Down

0 comments on commit 3b2c6f0

Please sign in to comment.