Skip to content
Snippets Groups Projects
Commit d57f5c70 authored by AW-UC's avatar AW-UC
Browse files

Fix sorting for files that only differ in case.

parent bc668600
No related branches found
No related tags found
No related merge requests found
...@@ -13,8 +13,11 @@ class NaturalSort_DefaultCollator { ...@@ -13,8 +13,11 @@ class NaturalSort_DefaultCollator {
public function compare($a, $b) { public function compare($a, $b) {
$result = strcasecmp($a, $b); $result = strcasecmp($a, $b);
if ($result === 0) { if ($result === 0) {
if ($a === $b) {
return 0; return 0;
} }
return ($a > $b) ? -1 : 1;
}
return ($result < 0) ? -1 : 1; return ($result < 0) ? -1 : 1;
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment