From 88894511a347805072e519bcc7897071a807413c Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 24 Nov 2018 11:38:36 +0000 Subject: [PATCH] Fixes a notice and wrong counting of nodes --- mod/admin.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/mod/admin.php b/mod/admin.php index cca109f48a..5bf55423e5 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -664,13 +664,17 @@ function admin_page_federation(App $a) } while (!empty($parts) && ((strlen($part) >= 40) || (strlen($part) <= 3))); if (!empty($part)) { - $compacted[$part] += $v[$key]['total']; + if (empty($compacted[$part])) { + $compacted[$part] = $v[$key]['total']; + } else { + $compacted[$part] += $v[$key]['total']; + } } } $v = []; - foreach ($compacted as $version => $total) { - $v[] = ['version' => $version, 'total' => $total]; + foreach ($compacted as $version => $pl_total) { + $v[] = ['version' => $version, 'total' => $pl_total]; } }