provide case-insensitive natural sorting

This makes OC's naturalsort_defaultcollator case-insensitive
This commit is contained in:
AW-UC 2015-02-18 15:49:03 +01:00
parent d665b7a4b1
commit 097d455213
1 changed files with 5 additions and 4 deletions

View File

@ -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;
}
}