From 2eaa61654b2adf67043d5eb3057271733a8858f4 Mon Sep 17 00:00:00 2001 From: AudioCore Bot Date: Thu, 5 Mar 2026 17:25:09 +0000 Subject: [PATCH] Fix custom CSS injection so base styles always load --- views/site/layout.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/views/site/layout.php b/views/site/layout.php index ab3a462..8d69f74 100644 --- a/views/site/layout.php +++ b/views/site/layout.php @@ -13,7 +13,8 @@ $seoDefaultDescription = trim(Settings::get('seo_meta_description', '')); $seoRobotsIndex = Settings::get('seo_robots_index', '1') === '1' ? 'index' : 'noindex'; $seoRobotsFollow = Settings::get('seo_robots_follow', '1') === '1' ? 'follow' : 'nofollow'; $seoOgImage = trim(Settings::get('seo_og_image', '')); -$siteCustomCss = (string)Settings::get('site_custom_css', ''); +$siteCustomCssRaw = (string)Settings::get('site_custom_css', ''); +$siteCustomCss = preg_replace('~<\s*/?\s*style\b[^>]*>~i', '', $siteCustomCssRaw) ?? $siteCustomCssRaw; $pageTitleValue = trim((string)($pageTitle ?? $siteTitleSetting)); $metaTitle = $pageTitleValue; if ($seoTitleSuffix !== '' && stripos($pageTitleValue, $seoTitleSuffix) === false) { @@ -527,10 +528,12 @@ if (session_status() === PHP_SESSION_ACTIVE && isset($_SESSION['ac_site_notice'] padding-top: 2px; } } - - - + + +