summaryrefslogtreecommitdiffstats
path: root/lib/group.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/group.php')
-rw-r--r--lib/group.php15
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/group.php b/lib/group.php
index 6afe1440030..8c06ddc0fd0 100644
--- a/lib/group.php
+++ b/lib/group.php
@@ -308,15 +308,16 @@ class OC_Group {
* @return array with display names (Key) user ids (value)
*/
public static function displayNamesInGroups($gids, $search = '', $limit = -1, $offset = 0) {
- $displayNames = array();
+ $displayNames = array();
foreach ($gids as $gid) {
// TODO Need to apply limits to groups as total
- $displayNames = array_merge(
- array_diff(
- self::displayNamesInGroup($gid, $search, $limit, $offset),
- $displayNames
- ),
- $displayNames);
+ $diff = array_diff(
+ self::displayNamesInGroup($gid, $search, $limit, $offset),
+ $displayNames
+ );
+ if ($diff) {
+ $displayNames = array_merge($diff, $displayNames);
+ }
}
return $displayNames;
}