Make WordPress Core

Ticket #38409: 38409.3.diff

File 38409.3.diff, 1.6 KB (added by mattwiebe, 8 years ago)
  • wp-includes/js/customize-base.js

     
    655655                                var urlParser = document.createElement( 'a' );
    656656                                urlParser.href = to;
    657657                                // Port stripping needed by IE since it adds to host but not to event.origin.
    658                                 return urlParser.protocol + '//' + urlParser.host.replace( /:80$/, '' );
     658                                return urlParser.protocol + '//' + urlParser.host.replace( /:(80|443)$/, '' );
    659659                        });
    660660
    661661                        // first add with no value
  • wp-includes/js/customize-preview.js

     
    286286                        return false;
    287287                }
    288288
    289                 elementHost = element.host.replace( /:80$/, '' );
     289                elementHost = element.host.replace( /:(80|443)$/, '' );
    290290                parsedAllowedUrl = document.createElement( 'a' );
    291291                matchesAllowedUrl = ! _.isUndefined( _.find( api.settings.url.allowed, function( allowedUrl ) {
    292292                        parsedAllowedUrl.href = allowedUrl;
    293                         return parsedAllowedUrl.protocol === element.protocol && parsedAllowedUrl.host.replace( /:80$/, '' ) === elementHost && 0 === element.pathname.indexOf( parsedAllowedUrl.pathname.replace( /\/$/, '' ) );
     293                        return parsedAllowedUrl.protocol === element.protocol && parsedAllowedUrl.host.replace( /:(80|443)$/, '' ) === elementHost && 0 === element.pathname.indexOf( parsedAllowedUrl.pathname.replace( /\/$/, '' ) );
    294294                } ) );
    295295                if ( ! matchesAllowedUrl ) {
    296296                        return false;