diff options
author | diosmosis <diosmosis@users.noreply.github.com> | 2022-07-11 05:04:02 +0300 |
---|---|---|
committer | diosmosis <diosmosis@users.noreply.github.com> | 2022-07-11 05:04:02 +0300 |
commit | f8da27b18c17d6e6692cf6d57e07baa9157de630 (patch) | |
tree | d052ddefc154af6946395f1041360873d5af023e /plugins/DevicesDetection/Controller.php | |
parent | 8934a46c66450ae59bd5b9514ec3ea09f9f069cb (diff) | |
parent | a0ec25efb4943d78e525b2183948c6f8fb526a71 (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.php | 5 |
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'); |