Fix sorting for files that only differ in case.
This commit is contained in:
parent
bc668600cd
commit
d57f5c70e9
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue