From 097d455213ff3134fbbf9689a4c1e739719b4c1e Mon Sep 17 00:00:00 2001 From: AW-UC Date: Wed, 18 Feb 2015 15:49:03 +0100 Subject: [PATCH] provide case-insensitive natural sorting This makes OC's naturalsort_defaultcollator case-insensitive --- lib/private/naturalsort_defaultcollator.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/private/naturalsort_defaultcollator.php b/lib/private/naturalsort_defaultcollator.php index e1007f8d7b..33b99d4ecb 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; } }