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

Commit b88b6f3

Browse files
committed
Merge pull request #5221 from jlembeck/master
Fix for issue 4882
2 parents 6fe7844 + b62d4e5 commit b88b6f3

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

js/jquery.mobile.navigation.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ define( [
4747
// [16]: ?msg=1234&type=unread
4848
// [17]: #msg-content
4949
//
50-
urlParseRE: /^(((([^:\/#\?]+:)?(?:(\/\/)((?:(([^:@\/#\?]+)(?:\:([^:@\/#\?]+))?)@)?(([^:\/#\?\]\[]+|\[[^\/\]@#?]+\])(?:\:([0-9]+))?))?)?)?((\/?(?:[^\/\?#]+\/+)*)([^\?#]*)))?(\?[^#]+)?)(#.*)?/,
50+
urlParseRE: /^\s*(((([^:\/#\?]+:)?(?:(\/\/)((?:(([^:@\/#\?]+)(?:\:([^:@\/#\?]+))?)@)?(([^:\/#\?\]\[]+|\[[^\/\]@#?]+\])(?:\:([0-9]+))?))?)?)?((\/?(?:[^\/\?#]+\/+)*)([^\?#]*)))?(\?[^#]+)?)(#.*)?/,
5151

5252
// Abstraction to address xss (Issue #4787) by removing the authority in
5353
// browsers that auto decode it. All references to location.href should be

tests/unit/navigation/navigation_core.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1307,4 +1307,18 @@
13071307
}
13081308
]);
13091309
});
1310+
1311+
asyncTest( "external page is accessed correctly even if it has a space in the url", function(){
1312+
$.testHelper.pageSequence([
1313+
function(){
1314+
$.mobile.changePage( " external.html" );
1315+
},
1316+
function(){
1317+
equal( $.mobile.activePage.attr( "id" ), "external-test", "the correct page is loaded" );
1318+
start();
1319+
}
1320+
1321+
]);
1322+
});
1323+
13101324
})(jQuery);

0 commit comments

Comments
 (0)