Skip to content

Commit a04ea05

Browse files
Merge branch 'master' of github.com:jquery/jquery-mobile
2 parents d5c2c45 + 60b2e24 commit a04ea05

File tree

4 files changed

+12
-30
lines changed

4 files changed

+12
-30
lines changed

js/jquery.mobile.navigation.js

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -49,27 +49,13 @@ define( [
4949
//
5050
urlParseRE: /^(((([^:\/#\?]+:)?(?:(\/\/)((?:(([^:@\/#\?]+)(?:\:([^:@\/#\?]+))?)@)?(([^:\/#\?\]\[]+|\[[^\/\]@#?]+\])(?:\:([0-9]+))?))?)?)?((\/?(?:[^\/\?#]+\/+)*)([^\?#]*)))?(\?[^#]+)?)(#.*)?/,
5151

52-
// Abstraction to address xss (Issue #4787) in browsers that auto decode the username:pass
53-
// portion of location.href. All references to location.href should be replaced with a call
54-
// to this method so that it can be dealt with properly here
52+
// Abstraction to address xss (Issue #4787) by removing the authority in
53+
// browsers that auto decode it. All references to location.href should be
54+
// replaced with a call to this method so that it can be dealt with properly here
5555
getLocation: function( url ) {
56-
var uri = this.parseUrl( url || location.href ),
57-
encodedUserPass = "";
56+
var uri = url ? $.mobile.path.parseUrl( url ) : location;
5857

59-
if( uri.username ){
60-
encodedUserPass = encodeURI( uri.username );
61-
}
62-
63-
if( uri.password ){
64-
encodedUserPass = encodedUserPass + ":" + encodeURI( uri.password );
65-
}
66-
67-
if( encodedUserPass ){
68-
return uri.protocol + "//" + encodedUserPass + "@" +
69-
uri.host + uri.pathname + uri.search + uri.hash;
70-
}
71-
72-
return uri.href;
58+
return uri.protocol + "//" + uri.host + uri.pathname + uri.search + uri.hash;
7359
},
7460

7561
parseLocation: function() {

js/jquery.ui.widget.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*!
2-
* jQuery UI Widget @VERSION
2+
* jQuery UI Widget v1.9.0-beta.1
33
*
4-
* Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
4+
* Copyright 2012, https://github.com/jquery/jquery-ui/blob/1.9.0-beta.1/AUTHORS.txt (http://jqueryui.com/about)
55
* Dual licensed under the MIT or GPL Version 2 licenses.
66
* http://jquery.org/license
77
*

tests/unit/navigation/navigation_helpers.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -241,14 +241,12 @@
241241

242242
test( "path.getLocation works properly", function() {
243243
equal( $.mobile.path.getLocation("http://example.com/"), "http://example.com/" );
244-
equal( $.mobile.path.getLocation("http://[email protected]"), "http://[email protected]" );
245-
equal( $.mobile.path.getLocation("http://foo:[email protected]"), "http://foo:[email protected]" );
246-
equal( $.mobile.path.getLocation("http://<foo<:[email protected]"), "http://%3Cfoo%3C:[email protected]" );
247-
equal( $.mobile.path.getLocation("http://foo:<bar<@example.com"), "http://foo:%3Cbar%[email protected]" );
248-
equal( $.mobile.path.getLocation("http://<foo<:<bar<@example.com"), "http://%3Cfoo%3C:%3Cbar%[email protected]" );
244+
equal( $.mobile.path.getLocation("http://[email protected]"), "http://example.com" );
245+
equal( $.mobile.path.getLocation("http://foo:[email protected]"), "http://example.com" );
246+
equal( $.mobile.path.getLocation("http://<foo<:[email protected]"), "http://example.com" );
249247

250248
var allUriParts = "http://jblas:[email protected]:8080/mail/inbox?msg=1234&type=unread#msg-content";
251249

252-
equal( $.mobile.path.getLocation( allUriParts ), allUriParts );
250+
equal( $.mobile.path.getLocation( allUriParts ), allUriParts.replace( "jblas:password@", "") );
253251
});
254252
})(jQuery);

tests/unit/support/support_core.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,7 @@ $.testHelper.excludeFileProtocol(function(){
4747
});
4848

4949
asyncTest( "detects touch", function() {
50-
$.extend(window, {
51-
touchend: true
52-
});
50+
document.ontouchend = true;
5351

5452
$.testHelper.reloadModule( "jquery.mobile.support.touch" ).done( function() {
5553
ok( $.mobile.support.touch, "touch is supported" );

0 commit comments

Comments
 (0)