From 4ac186e602a3071a0294aa3e1c456abc7fc1d711 Mon Sep 17 00:00:00 2001 From: Mathieu Lutfy Date: Wed, 14 Jun 2023 16:30:11 -0400 Subject: [PATCH] Fix for domains that have the string .css in them preg_match is used because we also have to match on items from the asset builder, which have URL params in the filename. Example: [...]q=civicrm%2Fasset%2Fbuilder&an=crm-menubar.css&ad=9caf2150754dca162f3a --- CRM/Core/Resources/Common.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CRM/Core/Resources/Common.php b/CRM/Core/Resources/Common.php index d034b267fa..e470406ace 100644 --- a/CRM/Core/Resources/Common.php +++ b/CRM/Core/Resources/Common.php @@ -129,7 +129,7 @@ class CRM_Core_Resources_Common { if (is_array($item)) { $bundle->addSetting($item); } - elseif (strpos($item, '.css')) { + elseif (preg_match('/(\.css$)|(\.css[?&])/', $item)) { Civi::resources()->isFullyFormedUrl($item) ? $bundle->addStyleUrl($item, -100) : $bundle->addStyleFile('civicrm', $item, -100); } elseif (Civi::resources()->isFullyFormedUrl($item)) { -- 2.25.1