]> git.mxchange.org Git - friendica.git/commitdiff
Checking the existence of '-' before array operation
authorPhilipp Holzer <admin+github@philipp.info>
Wed, 29 May 2019 17:56:18 +0000 (19:56 +0200)
committerPhilipp Holzer <admin+github@philipp.info>
Wed, 29 May 2019 18:07:53 +0000 (20:07 +0200)
See https://github.com/friendica/friendica/issues/6918#issuecomment-491490533

src/Module/Admin/Federation.php

index f32f0e2ccd6f15dcbcf2db0f16385c1804d14104..9c52845b93094f3c7a8c8e654701fc6bc2c4defb 100644 (file)
@@ -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'];