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

Commit fc8c9ba

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 a59a5f3 commit fc8c9ba

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
@@ -298,7 +298,7 @@ function $CompileProvider($provide) {
298298

299299
// href property always returns normalized absolute url, so we can match against that
300300
normalizedVal = urlSanitizationNode.href;
301-
if (!normalizedVal.match(urlSanitizationWhitelist)) {
301+
if (normalizedVal !== '' && !normalizedVal.match(urlSanitizationWhitelist)) {
302302
this[key] = value = 'unsafe:' + normalizedVal;
303303
}
304304
}

0 commit comments

Comments
 (0)