]> git.mxchange.org Git - friendica.git/commitdiff
Fix the version sorting in the federation statistics
authorMichael <heluecht@pirati.ca>
Sat, 31 Mar 2018 09:34:36 +0000 (09:34 +0000)
committerMichael <heluecht@pirati.ca>
Sat, 31 Mar 2018 09:34:36 +0000 (09:34 +0000)
mod/admin.php

index 3cbb70d3c54ec687b0b84b91c6320b72a81d4564..4ae5eb70b067b83eed1826b2c5708d187430629a 100644 (file)
@@ -635,8 +635,21 @@ function admin_page_federation(App $a)
                        $v = $newVv;
                }
 
-               foreach ($v as $key => $vv)
-                       $v[$key]["version"] = trim(strip_tags($vv["version"]));
+               // Assure that the versions are sorted correctly
+               $v2 = [];
+               $versions = [];
+               foreach ($v as $vv) {
+                       $version = trim(strip_tags($vv["version"]));
+                       $v2[$version] = $vv;
+                       $versions[] = $version;
+               }
+
+               usort($versions, 'version_compare');
+
+               $v = [];
+               foreach ($versions as $version) {
+                       $v[] = $v2[$version];
+               }
 
                // the 3rd array item is needed for the JavaScript graphs as JS does
                // not like some characters in the names of variables...