Skip to content
Extraits de code Groupes Projets
Valider 960e6053 rédigé par sgiehl's avatar sgiehl
Parcourir les fichiers

use constant for BOT os

parent 203b8aab
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -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'];
......
......@@ -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;
......
......@@ -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 != ";") {
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter