Permalink
Browse files

Merge pull request #5221 from jlembeck/master

Fix for issue 4882
  • Loading branch information...
2 parents 6fe7844 + b62d4e5 commit b88b6f3d613ff61d6a38f72808c0914edabb0ffc @gseguin gseguin committed Oct 26, 2012
Showing with 15 additions and 1 deletion.
  1. +1 −1 js/jquery.mobile.navigation.js
  2. +14 −0 tests/unit/navigation/navigation_core.js
View
2 js/jquery.mobile.navigation.js
@@ -47,7 +47,7 @@ define( [
// [16]: ?msg=1234&type=unread
// [17]: #msg-content
//
- urlParseRE: /^(((([^:\/#\?]+:)?(?:(\/\/)((?:(([^:@\/#\?]+)(?:\:([^:@\/#\?]+))?)@)?(([^:\/#\?\]\[]+|\[[^\/\]@#?]+\])(?:\:([0-9]+))?))?)?)?((\/?(?:[^\/\?#]+\/+)*)([^\?#]*)))?(\?[^#]+)?)(#.*)?/,
+ urlParseRE: /^\s*(((([^:\/#\?]+:)?(?:(\/\/)((?:(([^:@\/#\?]+)(?:\:([^:@\/#\?]+))?)@)?(([^:\/#\?\]\[]+|\[[^\/\]@#?]+\])(?:\:([0-9]+))?))?)?)?((\/?(?:[^\/\?#]+\/+)*)([^\?#]*)))?(\?[^#]+)?)(#.*)?/,
// Abstraction to address xss (Issue #4787) by removing the authority in
// browsers that auto decode it. All references to location.href should be
View
14 tests/unit/navigation/navigation_core.js
@@ -1307,4 +1307,18 @@
}
]);
});
+
+ asyncTest( "external page is accessed correctly even if it has a space in the url", function(){
+ $.testHelper.pageSequence([
+ function(){
+ $.mobile.changePage( " external.html" );
+ },
+ function(){
+ equal( $.mobile.activePage.attr( "id" ), "external-test", "the correct page is loaded" );
+ start();
+ }
+
+ ]);
+ });
+
})(jQuery);

0 comments on commit b88b6f3

Please sign in to comment.