Bladeren bron

Use case-insensitive sort for categories (#7402)

Changes proposed in this pull request:

- Use `strnatcasecmp()` inside `listSortedCategories()`

How to test the feature manually:

1. Create categories `A`, `b`, and `C`
2. Observe that categories are sorted case-insensitively on the feed index and Subscription Management pages
Annika Backstrom 1 jaar geleden
bovenliggende
commit
f40acd78cb
1 gewijzigde bestanden met toevoegingen van 1 en 1 verwijderingen
  1. 1 1
      app/Models/CategoryDAO.php

+ 1 - 1
app/Models/CategoryDAO.php

@@ -265,7 +265,7 @@ SQL;
 			$aPosition = $a->attributeInt('position');
 			$bPosition = $b->attributeInt('position');
 			if ($aPosition === $bPosition) {
-				return ($a->name() < $b->name()) ? -1 : 1;
+				return strnatcasecmp($a->name(), $b->name());
 			} elseif (null === $aPosition) {
 				return 1;
 			} elseif (null === $bPosition) {