Skip to content

Commit

Permalink
Merge pull request #11 from september-werbeagentur/fix/sorting
Browse files Browse the repository at this point in the history
fix natural sorting
  • Loading branch information
carlmrichter committed Aug 1, 2019
2 parents d4506f3 + e6f7c2f commit 022c82d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Module/ModulePropertyReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ protected function getImages($blob) {
protected static function sortByName($a, $b) {
if (strcmp($a['name'], $b['name']) === 0) return 0;
$compare = [$a['name'], $b['name']];
natsort($compare);
return (strcmp($compare[0], $a['name']) === 0) ? 1 : -1;
sort($compare, SORT_NATURAL);
return (strcmp($compare[0], $a['name']) === 0) ? -1 : 1;
}

protected static function sortByNumber($a, $b) {
Expand Down

0 comments on commit 022c82d

Please sign in to comment.