diff options
author | Stefan Giehl <stefan@matomo.org> | 2022-10-14 03:33:15 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-14 03:33:15 +0300 |
commit | d8cb2dfba80a4e8ef347890708e53871d2ce255a (patch) | |
tree | 2b6cc677643a2c5a2dc58d5473bf03f21a309312 | |
parent | 2740edb66f5938301a221f520ba1d127c2de32f1 (diff) |
Ensure client hints are always returned as array (#19855)
-rw-r--r-- | core/Tracker/Request.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/core/Tracker/Request.php b/core/Tracker/Request.php index 50a8fa87e4..ad7a84adc7 100644 --- a/core/Tracker/Request.php +++ b/core/Tracker/Request.php @@ -635,12 +635,14 @@ class Request return Common::getRequestVar('ua', $default, 'string', $this->params); } - public function getClientHints() + public function getClientHints(): array { // use headers as default if no data was send with the tracking request $default = Http::getClientHintsFromServerVariables(); - return Common::getRequestVar('uadata', $default, 'json', $this->params); + $clientHints = Common::getRequestVar('uadata', $default, 'json', $this->params); + + return is_array($clientHints) ? $clientHints : []; } public function shouldUseThirdPartyCookie() |