provide case-insensitive natural sorting
This makes OC's naturalsort_defaultcollator case-insensitive
This commit is contained in:
parent
d665b7a4b1
commit
097d455213
|
@ -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 New Issue