diff --git a/projects/packages/jetpack-mu-wpcom/changelog/fix-clean_up_loose_hostname_matches b/projects/packages/jetpack-mu-wpcom/changelog/fix-clean_up_loose_hostname_matches new file mode 100644 index 000000000000..838cb4533425 --- /dev/null +++ b/projects/packages/jetpack-mu-wpcom/changelog/fix-clean_up_loose_hostname_matches @@ -0,0 +1,5 @@ +Significance: patch +Type: fixed +Comment: Clean up loose hostname matches. + + diff --git a/projects/packages/jetpack-mu-wpcom/src/features/wpcom-themes/js/theme-actions.js b/projects/packages/jetpack-mu-wpcom/src/features/wpcom-themes/js/theme-actions.js index afe6d41ef7b5..70390fddce2b 100644 --- a/projects/packages/jetpack-mu-wpcom/src/features/wpcom-themes/js/theme-actions.js +++ b/projects/packages/jetpack-mu-wpcom/src/features/wpcom-themes/js/theme-actions.js @@ -10,7 +10,7 @@ const wpcomThemesRemoveWpcomActions = () => { for ( const node of mutation.addedNodes ) { const themeActions = node.querySelector( '.theme-actions .active-theme' ); for ( const action of themeActions?.children ?? [] ) { - if ( action.getAttribute( 'href' )?.includes( 'https://wordpress.com' ) ) { + if ( action.getAttribute( 'href' )?.startsWith( 'https://wordpress.com/' ) ) { themeActions.removeChild( action ); } } diff --git a/projects/packages/masterbar/changelog/fix-clean_up_loose_hostname_matches b/projects/packages/masterbar/changelog/fix-clean_up_loose_hostname_matches new file mode 100644 index 000000000000..838cb4533425 --- /dev/null +++ b/projects/packages/masterbar/changelog/fix-clean_up_loose_hostname_matches @@ -0,0 +1,5 @@ +Significance: patch +Type: fixed +Comment: Clean up loose hostname matches. + + diff --git a/projects/packages/masterbar/src/nudges/additional-css/additional-css.js b/projects/packages/masterbar/src/nudges/additional-css/additional-css.js index 4a8a88bc4438..5ab7667ccc0d 100644 --- a/projects/packages/masterbar/src/nudges/additional-css/additional-css.js +++ b/projects/packages/masterbar/src/nudges/additional-css/additional-css.js @@ -20,7 +20,7 @@ import './additional-css.css'; // Get destination. const destination = this.getAttribute( 'data-navigate-to-page' ); - if ( ! destination ) { + if ( ! destination?.startsWith( '/' ) ) { return; } diff --git a/projects/plugins/boost/app/modules/optimizations/image-cdn/src/srcset.ts b/projects/plugins/boost/app/modules/optimizations/image-cdn/src/srcset.ts index 77e6ca350ad1..b77ad648e52c 100644 --- a/projects/plugins/boost/app/modules/optimizations/image-cdn/src/srcset.ts +++ b/projects/plugins/boost/app/modules/optimizations/image-cdn/src/srcset.ts @@ -86,12 +86,19 @@ export function dynamicSrcset( img: HTMLImageElement ) { ! img.getAttribute( 'width' ) || ! img.getAttribute( 'height' ) || ! img.srcset || - ! img.src || - ! img.src.includes( '.wp.com' ) + ! img.src ) { return; } + try { + if ( ! new URL( img.src ).hostname.endsWith( '.wp.com' ) ) { + return; + } + } catch { + return; + } + const rect = img.getBoundingClientRect(); const targetSize = calculateTargetSize( rect ); diff --git a/projects/plugins/boost/changelog/fix-clean_up_loose_hostname_matches b/projects/plugins/boost/changelog/fix-clean_up_loose_hostname_matches new file mode 100644 index 000000000000..838cb4533425 --- /dev/null +++ b/projects/plugins/boost/changelog/fix-clean_up_loose_hostname_matches @@ -0,0 +1,5 @@ +Significance: patch +Type: fixed +Comment: Clean up loose hostname matches. + +