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:
authordiosmosis <diosmosis@users.noreply.github.com>2022-07-11 05:04:02 +0300
committerdiosmosis <diosmosis@users.noreply.github.com>2022-07-11 05:04:02 +0300
commitf8da27b18c17d6e6692cf6d57e07baa9157de630 (patch)
treed052ddefc154af6946395f1041360873d5af023e /plugins/DevicesDetection/Controller.php
parent8934a46c66450ae59bd5b9514ec3ea09f9f069cb (diff)
parenta0ec25efb4943d78e525b2183948c6f8fb526a71 (diff)
Merge branch '5.x-dev' into vue-remove-angularjs-Referrersvue-remove-angularjs-Referrers
Diffstat (limited to 'plugins/DevicesDetection/Controller.php')
-rw-r--r--plugins/DevicesDetection/Controller.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/plugins/DevicesDetection/Controller.php b/plugins/DevicesDetection/Controller.php
index d74ba9d527..dff2b25d67 100644
--- a/plugins/DevicesDetection/Controller.php
+++ b/plugins/DevicesDetection/Controller.php
@@ -8,6 +8,7 @@
*/
namespace Piwik\Plugins\DevicesDetection;
+use DeviceDetector\ClientHints;
use DeviceDetector\DeviceDetector;
use Piwik\Common;
use Piwik\Piwik;
@@ -25,11 +26,13 @@ class Controller extends \Piwik\Plugin\Controller
ControllerAdmin::setBasicVariablesAdminView($view);
$userAgent = Common::getRequestVar('ua', $_SERVER['HTTP_USER_AGENT'], 'string');
+ $clientHints = Common::getRequestVar('clienthints', '', 'json');
- $uaParser = new DeviceDetector($userAgent);
+ $uaParser = new DeviceDetector($userAgent, is_array($clientHints) ? ClientHints::factory($clientHints) : null);
$uaParser->parse();
$view->userAgent = $userAgent;
+ $view->clientHints = $clientHints;
$view->bot_info = $uaParser->getBot();
$view->browser_name = $uaParser->getClient('name');
$view->browser_short_name = $uaParser->getClient('short_name');