Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsgiehl <stefan@matomo.org>2022-10-13 10:29:34 +0300
committersgiehl <stefan@matomo.org>2022-10-13 10:29:34 +0300
commit1170310e63c6004bf4baf8eddcd7aaa3591e6c54 (patch)
tree9b90e5ecb9c62523256d980b3cdaa74e5358c3ad
parentf29b9903b318eb6128cd935ff2dac29d8ba0f197 (diff)
Ensure client hints are always returned as arrayfixclienthints
-rw-r--r--core/Tracker/Request.php6
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()