From cdccd9956a7d524700cee2d8aa7101ac645eadc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Tue, 6 Nov 2012 08:01:11 -0500 Subject: [PATCH] Tabs: Encode spaces from window.location. Fixes #8777 - Tabs fail in Safari 5.1 when window.location contains a space. (cherry picked from commit c6b52db892703ba14153800dbf620db509acb9e6) --- ui/jquery.ui.tabs.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ui/jquery.ui.tabs.js b/ui/jquery.ui.tabs.js index 0d920c3a137..8f09230c532 100644 --- a/ui/jquery.ui.tabs.js +++ b/ui/jquery.ui.tabs.js @@ -23,7 +23,12 @@ function getNextTabId() { function isLocal( anchor ) { return anchor.hash.length > 1 && - anchor.href.replace( rhash, "" ) === location.href.replace( rhash, "" ); + anchor.href.replace( rhash, "" ) === + location.href.replace( rhash, "" ) + // support: Safari 5.1 + // Safari 5.1 doesn't encode spaces in window.location + // but it does encode spaces from anchors (#8777) + .replace( /\s/g, "%20" ); } $.widget( "ui.tabs", {