diff options
author | Qingping Hou <dave2008713@gmail.com> | 2013-02-18 18:05:58 -0500 |
---|---|---|
committer | Qingping Hou <dave2008713@gmail.com> | 2013-02-18 18:05:58 -0500 |
commit | 2c78c5ccab763a74210ec8684f4582d0972e694e (patch) | |
tree | 7b3f97f44f2cfbe249256ddc4f9b38ffacc2f1a4 /lib/group.php | |
parent | c8e02060c1259760a18b9c9b0ac609088fd3015c (diff) | |
download | nextcloud-server-2c78c5ccab763a74210ec8684f4582d0972e694e.tar.gz nextcloud-server-2c78c5ccab763a74210ec8684f4582d0972e694e.zip |
bug fix for issue 1739, two changes included:
* fix typo in OC_Group_Database::DisplayNamesInGroup's SQL clause
* check array_diff return value in OC_Group::displayNamesInGroups,
when there is no difference between two arrays, it will return
NULL, so we have to take care of it.
Diffstat (limited to 'lib/group.php')
-rw-r--r-- | lib/group.php | 15 |
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;
} |