Skip to content

Commit cdccd99

Browse files
committed
Tabs: Encode spaces from window.location. Fixes #8777 - Tabs fail in Safari 5.1 when window.location contains a space.
(cherry picked from commit c6b52db)
1 parent 310dff1 commit cdccd99

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

ui/jquery.ui.tabs.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,12 @@ function getNextTabId() {
2323

2424
function isLocal( anchor ) {
2525
return anchor.hash.length > 1 &&
26-
anchor.href.replace( rhash, "" ) === location.href.replace( rhash, "" );
26+
anchor.href.replace( rhash, "" ) ===
27+
location.href.replace( rhash, "" )
28+
// support: Safari 5.1
29+
// Safari 5.1 doesn't encode spaces in window.location
30+
// but it does encode spaces from anchors (#8777)
31+
.replace( /\s/g, "%20" );
2732
}
2833

2934
$.widget( "ui.tabs", {

0 commit comments

Comments
 (0)