From face95c1dd4001cb75cb8f2d8d5c9d8fc2c6b7f3 Mon Sep 17 00:00:00 2001 From: Sarjuuk Date: Fri, 9 Jan 2026 17:22:37 +0100 Subject: [PATCH] PageTemplate/Consent * fix showing consent overlay when cookie is already set --- includes/components/pagetemplate.class.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/includes/components/pagetemplate.class.php b/includes/components/pagetemplate.class.php index c635a40d..eb2e35c9 100644 --- a/includes/components/pagetemplate.class.php +++ b/includes/components/pagetemplate.class.php @@ -470,16 +470,18 @@ class PageTemplate private function update() : void { // analytics + consent - if ($this->hasAnalytics && !isset($_COOKIE['consent'])) + // not set or declined + if (empty($_COOKIE['consent'])) + $this->hasAnalytics = false; + + // not set + if (!isset($_COOKIE['consent'])) { $this->addScript(SC_CSS_FILE, 'css/consent.css', SC_FLAG_NOCACHE); $this->addScript(SC_JS_FILE, 'js/consent.js', SC_FLAG_NOCACHE); $this->consentFooter = true; - $this->hasAnalytics = false; } - else if ($this->hasAnalytics && !$_COOKIE['consent']) - $this->hasAnalytics = false; // js + css $this->prepareScripts();