From 5002bda5fcfa2c0d9e1549869866effba35cf14b Mon Sep 17 00:00:00 2001 From: Philipp Holzer Date: Wed, 29 May 2019 19:56:18 +0200 Subject: [PATCH] Checking the existence of '-' before array operation See https://github.com/friendica/friendica/issues/6918#issuecomment-491490533 --- src/Module/Admin/Federation.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Module/Admin/Federation.php b/src/Module/Admin/Federation.php index f32f0e2ccd..9c52845b93 100644 --- a/src/Module/Admin/Federation.php +++ b/src/Module/Admin/Federation.php @@ -87,7 +87,9 @@ class Federation extends BaseAdminModule $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) && strpos($part, '-')) { + $part = array_shift(explode('-', $part)); + } if (!empty($part)) { if (empty($compacted[$part])) { $compacted[$part] = $versionCounts[$key]['total'];