aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/lib
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-02-18 12:29:05 +0100
committerVincent Petry <pvince81@owncloud.com>2014-08-11 13:28:53 +0200
commit173059f6d00faa06dab9188efb2d7536f15861e4 (patch)
tree2d3efee8b0e682b16d33fb8a37e7f5567b696800 /apps/files/lib
parent86ae3bd1e7d20e4f28ea9d7b9f71f1fdef0087aa (diff)
downloadnextcloud-server-173059f6d00faa06dab9188efb2d7536f15861e4.tar.gz
nextcloud-server-173059f6d00faa06dab9188efb2d7536f15861e4.zip
Fixed file list sorting
Now using a natural sort algorithm that is more consistent between JS and PHP (although not perfect in some corner cases) - added OC.Util.naturalSortComparator that uses the same algo that was used for the user list - changed user list and files list to use OC.Util.naturalSortComparator - removed toLowerCase() and changed the comparator to use String.localeCompare() - added unit tests - added OC_NaturalSort that is used by OCP\Util::naturalSortCompare()
Diffstat (limited to 'apps/files/lib')
-rw-r--r--apps/files/lib/helper.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/apps/files/lib/helper.php b/apps/files/lib/helper.php
index 50b4e8338a8..d857c1df154 100644
--- a/apps/files/lib/helper.php
+++ b/apps/files/lib/helper.php
@@ -66,7 +66,7 @@ class Helper
} elseif ($aType !== 'dir' and $bType === 'dir') {
return 1;
} else {
- return strnatcasecmp($a->getName(), $b->getName());
+ return \OCP\Util::naturalSortCompare($a->getName(), $b->getName());
}
}