WordPress.org

Make WordPress Core

Changeset 40335


Ignore:
Timestamp:
03/27/2017 06:20:19 AM (14 months ago)
Author:
swissspidy
Message:

Customize: Fix navigation of site in preview on IE11.

Addresses issue in IE11 where the default port number of :80 is unexpectedly included on link.host for links dynamically created by scripts.

Props westonruter, afercia for testing.
See #38409.
Fixes #40198.

Merges [40318] to the 4.7 branch.

Location:
branches/4.7
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.7

  • branches/4.7/src/wp-includes/js/customize-preview.js

    r40096 r40335  
    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 || {} );
     
    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 ) {
Note: See TracChangeset for help on using the changeset viewer.