mirror of
https://github.com/nextcloud/server.git
synced 2026-06-11 01:30:50 -04:00
provide case-insensitive natural sorting
This makes OC's naturalsort_defaultcollator case-insensitive
This commit is contained in:
parent
d665b7a4b1
commit
097d455213
1 changed files with 5 additions and 4 deletions
|
|
@ -11,9 +11,10 @@ namespace OC;
|
|||
|
||||
class NaturalSort_DefaultCollator {
|
||||
public function compare($a, $b) {
|
||||
if ($a === $b) {
|
||||
return 0;
|
||||
}
|
||||
return ($a < $b) ? -1 : 1;
|
||||
$result = strcasecmp($a, $b);
|
||||
if ($result === 0) {
|
||||
return 0;
|
||||
}
|
||||
return ($result < 0) ? -1 : 1;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue