Fix sorting for files that only differ in case.

This commit is contained in:
AW-UC 2015-02-24 23:50:38 +01:00
parent bc668600cd
commit d57f5c70e9
1 changed files with 8 additions and 5 deletions

View File

@ -11,10 +11,13 @@ namespace OC;
class NaturalSort_DefaultCollator {
public function compare($a, $b) {
$result = strcasecmp($a, $b);
if ($result === 0) {
return 0;
}
return ($result < 0) ? -1 : 1;
$result = strcasecmp($a, $b);
if ($result === 0) {
if ($a === $b) {
return 0;
}
return ($a > $b) ? -1 : 1;
}
return ($result < 0) ? -1 : 1;
}
}