From 507ae783bbef94b2ba7f1a26669fed7004834186 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Perona?= Date: Wed, 11 Dec 2024 14:51:46 -0500 Subject: [PATCH] update formatting for exclusions --- inc/Engine/Media/Fonts/Frontend/Controller.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/inc/Engine/Media/Fonts/Frontend/Controller.php b/inc/Engine/Media/Fonts/Frontend/Controller.php index e9c3dff8c7..3e169f9012 100644 --- a/inc/Engine/Media/Fonts/Frontend/Controller.php +++ b/inc/Engine/Media/Fonts/Frontend/Controller.php @@ -286,7 +286,13 @@ private function is_excluded( string $url, array $exclusions ): bool { // Escape each exclusion pattern to prevent regex issues. $escaped_exclusions = array_map( function ( $exclusion ) { - return preg_quote( $exclusion, '#' ); // '#' is used as the delimiter. + $query_string = preg_replace( '@(https?:)?(//)?fonts\.googleapis\.com/css2?\?@i', '', $exclusion ); + + return str_replace( + [ '.', '*', '#' ], + [ '\.', '\*', '\#' ], + $query_string + ); }, $exclusions );