Skip to content

Commit

Permalink
Always return an array on gcm modes (see #241)
Browse files Browse the repository at this point in the history
  • Loading branch information
a-kehr authored Jan 2, 2025
1 parent fcb5aa6 commit 17e476c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Resources/contao/classes/CookieHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ private function compileGoogleConsentMode()
}
}

if (!empty($modes = StringUtil::deserialize($this->gcmMode)))
if (!empty($modes = StringUtil::deserialize($this->gcmMode, true)))
{
$consent = "gtag('consent', 'update', { " . implode(', ', array_map(fn ($mode) => "'$mode':'granted'", $modes)) . " });";
$script = $gtagInit . $consent;
Expand Down

0 comments on commit 17e476c

Please sign in to comment.