aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2014-09-16 17:29:03 +0200
committerLukas Reschke <lukas@owncloud.com>2014-09-16 17:29:03 +0200
commitd2743e6ad66ba6827a0e49487ed83667671895c8 (patch)
tree1d50bf0f5364779e3f9e407a126d5694e69f4f00 /apps
parent4669ea38357f3f33caaf056d859e6318b75b72e1 (diff)
parentf2001a48a4e91bc6427a2a63ba9022ceaf1d305d (diff)
downloadnextcloud-server-d2743e6ad66ba6827a0e49487ed83667671895c8.tar.gz
nextcloud-server-d2743e6ad66ba6827a0e49487ed83667671895c8.zip
Merge pull request #7254 from owncloud/core-sortalgo
Fixed JS sort comparator to be consistent between JS and PHP
Diffstat (limited to 'apps')
-rw-r--r--apps/files/js/filelist.js2
-rw-r--r--apps/files/lib/helper.php2
2 files changed, 2 insertions, 2 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index 7c49c540d85..1aabfb91f1f 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -1971,7 +1971,7 @@
if (fileInfo1.type !== 'dir' && fileInfo2.type === 'dir') {
return 1;
}
- return fileInfo1.name.localeCompare(fileInfo2.name);
+ return OC.Util.naturalSortCompare(fileInfo1.name, fileInfo2.name);
},
/**
* Compares two file infos by size.
diff --git a/apps/files/lib/helper.php b/apps/files/lib/helper.php
index a0c0aa4952e..2a5233b6542 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());
}
}