[Pkg-owncloud-commits] [owncloud] 86/145: sort following entries in alphabetical order
David Prévot
taffit at moszumanska.debian.org
Wed Feb 26 16:27:44 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository owncloud.
commit 7e451a24bc9a3d085120aa932861dfba208dccd6
Author: Arthur Schiwon <blizzz at owncloud.com>
Date: Wed Jan 15 18:19:20 2014 +0100
sort following entries in alphabetical order
---
lib/private/share/searchresultsorter.php | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/lib/private/share/searchresultsorter.php b/lib/private/share/searchresultsorter.php
index 27f94a6..f64a476 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 {
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list