WordPress.org

Make WordPress Core

Changeset 38926


Ignore:
Timestamp:
10/25/2016 08:52:58 PM (5 years ago)
Author:
westonruter
Message:

Customize: Fix logic inversion in determining whether a URL is previewable which prevented previewing anything but homepage.

Fixes regression introduced in [38890].

See #38409.
Fixes #38492.

Location:
trunk/src
Files:
2 edited

Legend:

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

    r38906 r38926  
    41744174                    return ! _.isUndefined( _.find( previewer.allowedUrls, function( allowedUrl ) {
    41754175                        parsedAllowedUrl.href = allowedUrl;
    4176                         if ( urlParser.protocol === parsedAllowedUrl.protocol && urlParser.host === parsedAllowedUrl.host && 0 === parsedAllowedUrl.pathname.indexOf( urlParser.pathname ) ) {
     4176                        if ( urlParser.protocol === parsedAllowedUrl.protocol && urlParser.host === parsedAllowedUrl.host && 0 === urlParser.pathname.indexOf( parsedAllowedUrl.pathname.replace( /\/$/, '' ) ) ) {
    41774177                            result = parsedCandidateUrl.href;
    41784178                            return true;
  • trunk/src/wp-includes/js/customize-preview.js

    r38890 r38926  
    298298        matchesAllowedUrl = ! _.isUndefined( _.find( api.settings.url.allowed, function( allowedUrl ) {
    299299            parsedAllowedUrl.href = allowedUrl;
    300             return parsedAllowedUrl.protocol === element.protocol && parsedAllowedUrl.host === element.host && 0 === element.pathname.indexOf( parsedAllowedUrl.pathname );
     300            return parsedAllowedUrl.protocol === element.protocol && parsedAllowedUrl.host === element.host && 0 === element.pathname.indexOf( parsedAllowedUrl.pathname.replace( /\/$/, '' ) );
    301301        } ) );
    302302        if ( ! matchesAllowedUrl ) {
Note: See TracChangeset for help on using the changeset viewer.