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.


git-svn-id: https://develop.svn.wordpress.org/trunk@38926 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Weston Ruter
2016-10-25 20:52:58 +00:00
parent ea3b41d8e3
commit 87e7c0cd96
2 changed files with 2 additions and 2 deletions

View File

@@ -297,7 +297,7 @@
parsedAllowedUrl = document.createElement( 'a' );
matchesAllowedUrl = ! _.isUndefined( _.find( api.settings.url.allowed, function( allowedUrl ) {
parsedAllowedUrl.href = allowedUrl;
return parsedAllowedUrl.protocol === element.protocol && parsedAllowedUrl.host === element.host && 0 === element.pathname.indexOf( parsedAllowedUrl.pathname );
return parsedAllowedUrl.protocol === element.protocol && parsedAllowedUrl.host === element.host && 0 === element.pathname.indexOf( parsedAllowedUrl.pathname.replace( /\/$/, '' ) );
} ) );
if ( ! matchesAllowedUrl ) {
return false;