Backport updated Pleroma version number handling
This commit is contained in:
parent
db5b66e6f1
commit
3d64ac603e
|
@ -84,14 +84,14 @@ class Federation extends BaseAdminModule
|
||||||
// Reformat and compact version numbers
|
// Reformat and compact version numbers
|
||||||
if ($platform == 'Pleroma') {
|
if ($platform == 'Pleroma') {
|
||||||
$compacted = [];
|
$compacted = [];
|
||||||
|
|
||||||
foreach ($versionCounts as $key => $value) {
|
foreach ($versionCounts as $key => $value) {
|
||||||
$version = $versionCounts[$key]['version'];
|
$version = $versionCounts[$key]['version'];
|
||||||
$parts = explode(' ', trim($version));
|
$parts = explode(' ', trim($version));
|
||||||
do {
|
do {
|
||||||
$part = array_pop($parts);
|
$part = array_pop($parts);
|
||||||
} while (!empty($parts) && ((strlen($part) >= 40) || (strlen($part) <= 3)));
|
} 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($part)) {
|
||||||
if (empty($compacted[$part])) {
|
if (empty($compacted[$part])) {
|
||||||
$compacted[$part] = $versionCounts[$key]['total'];
|
$compacted[$part] = $versionCounts[$key]['total'];
|
||||||
|
|
Loading…
Reference in a new issue