Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@owncloud.com>2014-01-15 21:19:20 +0400
committerArthur Schiwon <blizzz@owncloud.com>2014-02-10 17:53:59 +0400
commit7e451a24bc9a3d085120aa932861dfba208dccd6 (patch)
treee7a16985ec1c4ccf8c724309ec4c7877257bfdf6
parentf8620704d492287d5acb18bdc60b3a1303c01ad1 (diff)
sort following entries in alphabetical order
-rw-r--r--lib/private/share/searchresultsorter.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/private/share/searchresultsorter.php b/lib/private/share/searchresultsorter.php
index 27f94a694ac..f64a4766ade 100644
--- a/lib/private/share/searchresultsorter.php
+++ b/lib/private/share/searchresultsorter.php
@@ -27,7 +27,7 @@ class SearchResultSorter {
/**
* User and Group names matching the search term at the beginning shall appear
- * on top of the share dialog.
+ * on top of the share dialog. Following entries in alphabetical order.
* Callback function for usort. http://php.net/usort
*/
public function sort($a, $b) {
@@ -41,8 +41,9 @@ class SearchResultSorter {
$i = mb_strpos($nameA, $this->search, 0, $this->encoding);
$j = mb_strpos($nameB, $this->search, 0, $this->encoding);
- if($i === $j) {
- return 0;
+ if($i === $j || $i > 0 && $j > 0) {
+ return strcmp(mb_strtolower($nameA, $this->encoding),
+ mb_strtolower($nameB, $this->encoding));
} elseif ($i === 0) {
return -1;
} else {