From 2068a3e6da3566c0dcec7e0ec6bcf96169b8c2a8 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Thu, 3 Oct 2013 01:49:59 +0000 Subject: [PATCH] When determining a frontend, local URL in the theme customizer, match the home URL without a trailing slash. props SergeyBiryukov. fixes #25315. git-svn-id: https://develop.svn.wordpress.org/trunk@25681 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/js/customize-controls.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/wp-admin/js/customize-controls.js b/src/wp-admin/js/customize-controls.js index 7f04e408b9..f780db7c75 100644 --- a/src/wp-admin/js/customize-controls.js +++ b/src/wp-admin/js/customize-controls.js @@ -553,14 +553,19 @@ // Check for URLs that include "/wp-admin/" or end in "/wp-admin". // Strip hashes and query strings before testing. - if ( /\/wp-admin(\/|$)/.test( to.replace(/[#?].*$/, '') ) ) + if ( /\/wp-admin(\/|$)/.test( to.replace( /[#?].*$/, '' ) ) ) return null; // Attempt to match the URL to the control frame's scheme // and check if it's allowed. If not, try the original URL. $.each([ to.replace( rscheme, self.scheme() ), to ], function( i, url ) { $.each( self.allowedUrls, function( i, allowed ) { - if ( 0 === url.indexOf( allowed ) ) { + var path; + + allowed = allowed.replace( /\/+$/, '' ); + path = url.replace( allowed, '' ); + + if ( 0 === url.indexOf( allowed ) && /^([/#?]|$)/.test( path ) ) { result = url; return false; }