]> source.dussan.org Git - jquery-ui.git/commitdiff
Tabs: Decode URIs before comparing. Fixes #8877 - Tabs: isLocal function issue in...
authorScott González <scott.gonzalez@gmail.com>
Wed, 5 Dec 2012 22:19:14 +0000 (17:19 -0500)
committerScott González <scott.gonzalez@gmail.com>
Wed, 5 Dec 2012 22:19:14 +0000 (17:19 -0500)
ui/jquery.ui.tabs.js

index dcb0c27689f47e2847d70d6911960ec0df944418..bce0585a023a10a1f270dc972f0b66f2a8df75bc 100644 (file)
@@ -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", {