summaryrefslogtreecommitdiffstats
path: root/lib/private/naturalsort_defaultcollator.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/naturalsort_defaultcollator.php')
-rw-r--r--lib/private/naturalsort_defaultcollator.php13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/private/naturalsort_defaultcollator.php b/lib/private/naturalsort_defaultcollator.php
index 33b99d4ecbb..63136aac749 100644
--- a/lib/private/naturalsort_defaultcollator.php
+++ b/lib/private/naturalsort_defaultcollator.php
@@ -11,10 +11,13 @@ namespace OC;
class NaturalSort_DefaultCollator {
public function compare($a, $b) {
- $result = strcasecmp($a, $b);
- if ($result === 0) {
- return 0;
- }
- return ($result < 0) ? -1 : 1;
+ $result = strcasecmp($a, $b);
+ if ($result === 0) {
+ if ($a === $b) {
+ return 0;
+ }
+ return ($a > $b) ? -1 : 1;
+ }
+ return ($result < 0) ? -1 : 1;
}
}