Changeset 40318
- Timestamp:
- 03/23/2017 05:24:08 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/js/customize-preview.js
r40064 r40318 274 274 */ 275 275 api.isLinkPreviewable = function isLinkPreviewable( element, options ) { 276 var matchesAllowedUrl, parsedAllowedUrl, args ;276 var matchesAllowedUrl, parsedAllowedUrl, args, elementHost; 277 277 278 278 args = _.extend( {}, { allowAdminAjax: false }, options || {} ); … … 287 287 } 288 288 289 elementHost = element.host.replace( /:80$/, '' ); 289 290 parsedAllowedUrl = document.createElement( 'a' ); 290 291 matchesAllowedUrl = ! _.isUndefined( _.find( api.settings.url.allowed, function( allowedUrl ) { 291 292 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( /\/$/, '' ) ); 293 294 } ) ); 294 295 if ( ! matchesAllowedUrl ) {
Note: See TracChangeset
for help on using the changeset viewer.