From: Scott González Date: Wed, 5 Dec 2012 22:19:14 +0000 (-0500) Subject: Tabs: Decode URIs before comparing. Fixes #8877 - Tabs: isLocal function issue in... X-Git-Tag: 1.10.0-beta.1~39 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=1e5662ebe5a27d5ef0b8d60730b21771a2526547;p=jquery-ui.git Tabs: Decode URIs before comparing. Fixes #8877 - Tabs: isLocal function issue in Safari 5.1.7. --- diff --git a/ui/jquery.ui.tabs.js b/ui/jquery.ui.tabs.js index dcb0c2768..bce0585a0 100644 --- a/ui/jquery.ui.tabs.js +++ b/ui/jquery.ui.tabs.js @@ -23,12 +23,8 @@ function getNextTabId() { function isLocal( anchor ) { return anchor.hash.length > 1 && - 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" ); + decodeURIComponent( anchor.href.replace( rhash, "" ) ) === + decodeURIComponent( location.href.replace( rhash, "" ) ); } $.widget( "ui.tabs", {