From a9716ea13e421c956ddb54f43e7e5483904621a0 Mon Sep 17 00:00:00 2001 From: Thomas Skerbis Date: Mon, 16 Feb 2026 16:55:14 +0100 Subject: [PATCH 1/2] fix: respect outputowncss setting and add missing CSP nonce Fixes #458: Inline CSS and style attributes now only output when 'Use custom CSS' is disabled - Wrap style block in conditional check for outputowncss and css_framework_mode - Make inline style attribute on headline element conditional - Reuse $addon variable to avoid repeated rex_addon::get() calls Fixes #459: Add missing CSP nonce attribute to script tag in theme_editor.php - Backend script now has nonce attribute for CSP compliance Performance: - Store rex_addon::get('consent_manager') in $addon variable - Reuse $cssFrameworkMode variable instead of calling getConfig again --- fragments/ConsentManager/box.php | 16 +++++++++++----- fragments/ConsentManager/theme_editor.php | 2 +- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/fragments/ConsentManager/box.php b/fragments/ConsentManager/box.php index 23c596a2..ea9af340 100644 --- a/fragments/ConsentManager/box.php +++ b/fragments/ConsentManager/box.php @@ -10,17 +10,18 @@ use FriendsOfRedaxo\ConsentManager\Frontend; +$addon = rex_addon::get('consent_manager'); $consent_manager = new Frontend(0); if (is_string(rex_request::server('HTTP_HOST'))) { $consent_manager->setDomain(rex_request::server('HTTP_HOST')); } if (0 === count($consent_manager->texts)) { - echo ''; + echo ''; return; } // Check for CSS Framework Mode -$cssFrameworkMode = rex_addon::get('consent_manager')->getConfig('css_framework_mode'); +$cssFrameworkMode = $addon->getConfig('css_framework_mode'); if ($cssFrameworkMode) { echo $this->parse('ConsentManager/box_' . $cssFrameworkMode . '.php'); return; @@ -28,9 +29,13 @@ if (0 < count($consent_manager->cookiegroups)) : ?>