WordPress.org

Make WordPress Core

Ticket #40198: 40198.0.diff

File 40198.0.diff, 1.3 KB (added by westonruter, 4 years ago)
  • src/wp-includes/js/customize-preview.js

    diff --git src/wp-includes/js/customize-preview.js src/wp-includes/js/customize-preview.js
    index d95f804bcd..7b8804d3ed 100644
     
    273273         * @returns {boolean} Is appropriate for changeset link.
    274274         */
    275275        api.isLinkPreviewable = function isLinkPreviewable( element, options ) {
    276                 var matchesAllowedUrl, parsedAllowedUrl, args;
     276                var matchesAllowedUrl, parsedAllowedUrl, args, elementHost;
    277277
    278278                args = _.extend( {}, { allowAdminAjax: false }, options || {} );
    279279
     
    286286                        return false;
    287287                }
    288288
     289                elementHost = element.host.replace( /:80$/, '' );
    289290                parsedAllowedUrl = document.createElement( 'a' );
    290291                matchesAllowedUrl = ! _.isUndefined( _.find( api.settings.url.allowed, function( allowedUrl ) {
    291292                        parsedAllowedUrl.href = allowedUrl;
    292                         return parsedAllowedUrl.protocol === element.protocol && parsedAllowedUrl.host === element.host && 0 === element.pathname.indexOf( parsedAllowedUrl.pathname.replace( /\/$/, '' ) );
     293                        return parsedAllowedUrl.protocol === element.protocol && parsedAllowedUrl.host.replace( /:80$/, '' ) === elementHost && 0 === element.pathname.indexOf( parsedAllowedUrl.pathname.replace( /\/$/, '' ) );
    293294                } ) );
    294295                if ( ! matchesAllowedUrl ) {
    295296                        return false;