1
1
Fork 0

Backport updated Pleroma version number handling

This commit is contained in:
Hypolite Petovan 2019-04-26 09:11:58 -04:00
parent db5b66e6f1
commit 3d64ac603e

View file

@ -84,14 +84,14 @@ class Federation extends BaseAdminModule
// Reformat and compact version numbers
if ($platform == 'Pleroma') {
$compacted = [];
foreach ($versionCounts as $key => $value) {
$version = $versionCounts[$key]['version'];
$parts = explode(' ', trim($version));
do {
$part = array_pop($parts);
} while (!empty($parts) && ((strlen($part) >= 40) || (strlen($part) <= 3)));
// only take the x.x.x part of the version, not the "release" after the dash
$part = array_shift(explode('-', $part));
if (!empty($part)) {
if (empty($compacted[$part])) {
$compacted[$part] = $versionCounts[$key]['total'];