Skip to content

Commit

Permalink
Update modules/cms/classes/Controller.php
Browse files Browse the repository at this point in the history
  • Loading branch information
LukeTowers authored Sep 7, 2023
1 parent 4dc0d5f commit cd7ac47
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions modules/cms/classes/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down

0 comments on commit cd7ac47

Please sign in to comment.