diff options
Diffstat (limited to 'lib/private/naturalsort_defaultcollator.php')
-rw-r--r-- | lib/private/naturalsort_defaultcollator.php | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/private/naturalsort_defaultcollator.php b/lib/private/naturalsort_defaultcollator.php index f777cfd794f..94db6dfbae5 100644 --- a/lib/private/naturalsort_defaultcollator.php +++ b/lib/private/naturalsort_defaultcollator.php @@ -22,9 +22,13 @@ namespace OC; class NaturalSort_DefaultCollator { public function compare($a, $b) { - if ($a === $b) { - return 0; + $result = strcasecmp($a, $b); + if ($result === 0) { + if ($a === $b) { + return 0; + } + return ($a > $b) ? -1 : 1; } - return ($a < $b) ? -1 : 1; + return ($result < 0) ? -1 : 1; } } |