Skip to content

Commit

Permalink
sort upgrade array by version
Browse files Browse the repository at this point in the history
  • Loading branch information
vendeeglobe committed Dec 21, 2020
1 parent 3992bf1 commit 18110b2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions wacko/setup/install-database.php
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,9 @@
else
{
// The funny upgrading stuff. Make sure these are in order!
ksort($upgrade, SORT_STRING);
uksort($upgrade, function($a, $b) {
return version_compare ($a, $b);
});

foreach (array_keys($upgrade) as $to_version) // index == value, BTW
{
Expand Down Expand Up @@ -452,7 +454,9 @@
else
{
// The funny upgrading stuff. Make sure these are in order!
ksort($upgrade, SORT_STRING);
uksort($upgrade, function($a, $b) {
return version_compare ($a, $b);
});

foreach (array_keys($upgrade) as $to_version) // index == value, BTW
{
Expand Down

0 comments on commit 18110b2

Please sign in to comment.