From cd7ac47552047eb700d0a822746ce977dbc1de36 Mon Sep 17 00:00:00 2001 From: Luke Towers Date: Wed, 6 Sep 2023 21:12:50 -0600 Subject: [PATCH] Update modules/cms/classes/Controller.php --- modules/cms/classes/Controller.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/cms/classes/Controller.php b/modules/cms/classes/Controller.php index 5e12fbb6f4..dd67cc728c 100644 --- a/modules/cms/classes/Controller.php +++ b/modules/cms/classes/Controller.php @@ -324,10 +324,9 @@ public function runPage($page, $useAjax = true) */ $globalVars = ViewHelper::getGlobalVars(); if (!empty($globalVars)) { - $specified = array_keys($this->getTwig()->getGlobals()); - + $existingGlobals = array_keys($this->getTwig()->getGlobals()); foreach ($globalVars as $key => $value) { - if (!in_array($key, $specified)) { + if (!in_array($key, $existingGlobals)) { $this->getTwig()->addGlobal($key, $value); } }