Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Commit

Permalink
Navigation: Compare domains case-insensitively inside $.mobile.path
Browse files Browse the repository at this point in the history
Fixes gh-2446
  • Loading branch information
Gabriel Schulhof committed Jun 10, 2014
1 parent 2f7d1c6 commit 6bb22d7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions js/navigation/path.js
Expand Up @@ -154,7 +154,8 @@ define([

//Returns true if both urls have the same domain.
isSameDomain: function( absUrl1, absUrl2 ) {
return path.parseUrl( absUrl1 ).domain === path.parseUrl( absUrl2 ).domain;
return path.parseUrl( absUrl1 ).domain.toLowerCase() ===
path.parseUrl( absUrl2 ).domain.toLowerCase();
},

//Returns true for any relative variant.
Expand Down Expand Up @@ -262,7 +263,9 @@ define([
//could be mailto, etc
isExternal: function( url ) {
var u = path.parseUrl( url );
return u.protocol && u.domain !== this.documentUrl.domain ? true : false;

return !!( u.protocol &&
( u.domain.toLowerCase() !== this.documentUrl.domain.toLowerCase() ) );
},

hasProtocol: function( url ) {
Expand Down

0 comments on commit 6bb22d7

Please sign in to comment.