summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/private/naturalsort_defaultcollator.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/private/naturalsort_defaultcollator.php b/lib/private/naturalsort_defaultcollator.php
index e1007f8d7b4..33b99d4ecbb 100644
--- a/lib/private/naturalsort_defaultcollator.php
+++ b/lib/private/naturalsort_defaultcollator.php
@@ -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;
}
}