}
if (!empty($data['network'])) {
- $serverdata['platform'] = $data['network'];
+ $serverdata['platform'] = strtolower($data['network']);
- if ($serverdata['platform'] == 'Diaspora') {
+ if ($serverdata['platform'] == 'diaspora') {
$serverdata['network'] = Protocol::DIASPORA;
- } elseif ($serverdata['platform'] == 'Friendica') {
+ } elseif ($serverdata['platform'] == 'friendica') {
$serverdata['network'] = Protocol::DFRN;
} elseif ($serverdata['platform'] == 'hubzilla') {
$serverdata['network'] = Protocol::ZOT;
if (is_array($nodeinfo['software'])) {
if (!empty($nodeinfo['software']['name'])) {
- $server['platform'] = $nodeinfo['software']['name'];
+ $server['platform'] = strtolower($nodeinfo['software']['name']);
}
if (!empty($nodeinfo['software']['version'])) {
if (is_array($nodeinfo['software'])) {
if (!empty($nodeinfo['software']['name'])) {
- $server['platform'] = $nodeinfo['software']['name'];
+ $server['platform'] = strtolower($nodeinfo['software']['name']);
}
if (!empty($nodeinfo['software']['version'])) {
}
if (!empty($data['url'])) {
- $serverdata['platform'] = $data['platform'];
+ $serverdata['platform'] = strtolower($data['platform']);
$serverdata['version'] = $data['version'];
}
}
if (!empty($serverdata['version']) && preg_match('/.*?\(compatible;\s(.*)\s(.*)\)/ism', $serverdata['version'], $matches)) {
- $serverdata['platform'] = $matches[1];
+ $serverdata['platform'] = strtolower($matches[1]);
$serverdata['version'] = $matches[2];
}
}
if (!empty($data['site']['platform'])) {
- $serverdata['platform'] = $data['site']['platform']['PLATFORM_NAME'];
+ $serverdata['platform'] = strtolower($data['site']['platform']['PLATFORM_NAME']);
$serverdata['version'] = $data['site']['platform']['STD_VERSION'];
$serverdata['network'] = Protocol::ZOT;
}
if (!empty($data['site']['hubzilla'])) {
- $serverdata['platform'] = $data['site']['hubzilla']['PLATFORM_NAME'];
+ $serverdata['platform'] = strtolower($data['site']['hubzilla']['PLATFORM_NAME']);
$serverdata['version'] = $data['site']['hubzilla']['RED_VERSION'];
$serverdata['network'] = Protocol::ZOT;
}
if (!empty($data['site']['redmatrix'])) {
if (!empty($data['site']['redmatrix']['PLATFORM_NAME'])) {
- $serverdata['platform'] = $data['site']['redmatrix']['PLATFORM_NAME'];
+ $serverdata['platform'] = strtolower($data['site']['redmatrix']['PLATFORM_NAME']);
} elseif (!empty($data['site']['redmatrix']['RED_PLATFORM'])) {
- $serverdata['platform'] = $data['site']['redmatrix']['RED_PLATFORM'];
+ $serverdata['platform'] = strtolower($data['site']['redmatrix']['RED_PLATFORM']);
}
$serverdata['version'] = $data['site']['redmatrix']['RED_VERSION'];
break;
}
- $serverdata['platform'] = $data['platform'] ?? '';
+ $serverdata['platform'] = strtolower($data['platform'] ?? '');
return $serverdata;
}
}
if ($attr['name'] == 'application-name') {
- $serverdata['platform'] = $attr['content'];
+ $serverdata['platform'] = strtolower($attr['content']);
if (in_array($attr['content'], ['Misskey', 'Write.as'])) {
$serverdata['network'] = Protocol::ACTIVITYPUB;
}
}
if ($attr['name'] == 'generator') {
- $serverdata['platform'] = $attr['content'];
+ $serverdata['platform'] = strtolower($attr['content']);
$version_part = explode(' ', $attr['content']);
if (count($version_part) == 2) {
if (in_array($version_part[0], ['WordPress'])) {
- $serverdata['platform'] = $version_part[0];
+ $serverdata['platform'] = strtolower($version_part[0]);
$serverdata['version'] = $version_part[1];
// We still do need a reliable test if some AP plugin is activated
}
}
if (in_array($version_part[0], ['Friendika', 'Friendica'])) {
- $serverdata['platform'] = $version_part[0];
+ $serverdata['platform'] = strtolower($version_part[0]);
$serverdata['version'] = $version_part[1];
$serverdata['network'] = Protocol::DFRN;
}
}
if ($attr['property'] == 'og:platform') {
- $serverdata['platform'] = $attr['content'];
+ $serverdata['platform'] = strtolower($attr['content']);
if (in_array($attr['content'], ['PeerTube'])) {
$serverdata['network'] = Protocol::ACTIVITYPUB;
}
if ($attr['property'] == 'generator') {
- $serverdata['platform'] = $attr['content'];
+ $serverdata['platform'] = strtolower($attr['content']);
if (in_array($attr['content'], ['hubzilla'])) {
// We later check which compatible protocol modules are loaded.
// get counts on active federation systems this node is knowing
// We list the more common systems by name. The rest is counted as "other"
$systems = [
- 'Friendica' => ['name' => 'Friendica', 'color' => '#ffc018'], // orange from the logo
+ 'friendica' => ['name' => 'Friendica', 'color' => '#ffc018'], // orange from the logo
'diaspora' => ['name' => 'Diaspora', 'color' => '#a1a1a1'], // logo is black and white, makes a gray
'funkwhale' => ['name' => 'Funkwhale', 'color' => '#4082B4'], // From the homepage
'gnusocial' => ['name' => 'GNU Social/Statusnet', 'color' => '#a22430'], // dark red from the logo
}
DBA::close($versions);
- $platform = $gserver['platform'];
+ $platform = $gserver['platform'] = strtolower($gserver['platform']);
- if ($platform == 'Friendika') {
- $platform = 'Friendica';
- } elseif (in_array($platform, ['Red Matrix', 'redmatrix', 'red'])) {
+ if ($platform == 'friendika') {
+ $platform = 'friendica';
+ } elseif (in_array($platform, ['red matrix', 'redmatrix', 'red'])) {
$platform = 'hubzilla';
} elseif(stristr($platform, 'pleroma')) {
$platform = 'pleroma';
$gserver['users'] += $counts[$platform][0]['users'] ?? 0;
}
- if ($platform == 'Friendica') {
+ if ($platform == 'friendica') {
$versionCounts = self::reformaFriendicaVersions($versionCounts);
} elseif ($platform == 'pleroma') {
$versionCounts = self::reformaPleromaVersions($versionCounts);