diff options
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'); |