diff --git a/core/Tracker/Settings.php b/core/Tracker/Settings.php index b7bf1c05f60fabeefc90233cedd9bcef9a07350b..10623c3d1c19b0a6668d09d1af094c699e83b412 100644 --- a/core/Tracker/Settings.php +++ b/core/Tracker/Settings.php @@ -15,6 +15,8 @@ use DeviceDetector\DeviceDetector; class Settings { + const OS_BOT = 'BOT'; + function __construct(Request $request, $ip) { $this->request = $request; @@ -50,7 +52,7 @@ class Settings $browserVersion = !empty($aBrowserInfo['version']) ? $aBrowserInfo['version'] : ''; if ($deviceDetector->isBot()) { - $os = 'BOT'; + $os = self::OS_BOT; } else { $os = $deviceDetector->getOS(); $os = empty($os['short_name']) ? 'UNK' : $os['short_name']; diff --git a/plugins/DevicesDetection/Controller.php b/plugins/DevicesDetection/Controller.php index bfd3af4dbbd0591e1987ef71308ae24dcb238b69..57196991fa09abedf75629f10158f6f310a8081a 100644 --- a/plugins/DevicesDetection/Controller.php +++ b/plugins/DevicesDetection/Controller.php @@ -140,9 +140,7 @@ class Controller extends \Piwik\Plugin\Controller $availableOSs = \DeviceDetector\Parser\OperatingSystem::getAvailableOperatingSystems(); foreach ($availableOSs AS $short => $name) { - if ($name != 'Bot') { - $list[$name] = getOsLogoExtended($short); - } + $list[$name] = getOsLogoExtended($short); } break; @@ -150,9 +148,7 @@ class Controller extends \Piwik\Plugin\Controller $osFamilies = \DeviceDetector\Parser\OperatingSystem::getAvailableOperatingSystemFamilies(); foreach ($osFamilies AS $name => $oss) { - if ($name != 'Bot') { - $list[$name] = getOsFamilyLogoExtended($name); - } + $list[$name] = getOsFamilyLogoExtended($name); } break; diff --git a/plugins/DevicesDetection/functions.php b/plugins/DevicesDetection/functions.php index 1ce60135583c3d8ea18127959a95b91bc573d647..376912b03500051f2770da5dc5b839396408700b 100644 --- a/plugins/DevicesDetection/functions.php +++ b/plugins/DevicesDetection/functions.php @@ -165,7 +165,7 @@ function getModelName($label) function getOSFamilyFullNameExtended($label) { - if ($label == 'BOT') { + if ($label == \Piwik\Tracker\Settings::OS_BOT) { return 'Bot'; } $label = OperatingSystemParser::getOsFamily($label); @@ -186,7 +186,7 @@ function getOsFamilyLogoExtended($label) function getOsFullNameExtended($label) { - if (substr($label, 0, 3) == 'BOT') { + if (substr($label, 0, 3) == \Piwik\Tracker\Settings::OS_BOT) { return 'Bot'; } if (!empty($label) && $label != ";") {