Make WordPress Core

Changeset 25681


Ignore:
Timestamp:
10/03/2013 01:49:59 AM (11 years ago)
Author:
nacin
Message:

When determining a frontend, local URL in the theme customizer, match the home URL without a trailing slash.

props SergeyBiryukov.
fixes #25315.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/js/customize-controls.js

    r25680 r25681  
    554554                // Check for URLs that include "/wp-admin/" or end in "/wp-admin".
    555555                // Strip hashes and query strings before testing.
    556                 if ( /\/wp-admin(\/|$)/.test( to.replace(/[#?].*$/, '') ) )
     556                if ( /\/wp-admin(\/|$)/.test( to.replace( /[#?].*$/, '' ) ) )
    557557                    return null;
    558558
     
    561561                $.each([ to.replace( rscheme, self.scheme() ), to ], function( i, url ) {
    562562                    $.each( self.allowedUrls, function( i, allowed ) {
    563                         if ( 0 === url.indexOf( allowed ) ) {
     563                        var path;
     564
     565                        allowed = allowed.replace( /\/+$/, '' );
     566                        path = url.replace( allowed, '' );
     567
     568                        if ( 0 === url.indexOf( allowed ) && /^([/#?]|$)/.test( path ) ) {
    564569                            result = url;
    565570                            return false;
Note: See TracChangeset for help on using the changeset viewer.