diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2016-01-28 17:40:59 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2016-02-03 17:18:22 +0100 |
commit | 0753067bcd1b00f38e650c6b0975bdb67d132774 (patch) | |
tree | e6190e6d0faa6ee6d4b538f81b11790ca8b516d5 /apps/dav/lib | |
parent | 18c35bf812b1f5db55fb74006f13237c0cb2fe3f (diff) | |
download | nextcloud-server-0753067bcd1b00f38e650c6b0975bdb67d132774.tar.gz nextcloud-server-0753067bcd1b00f38e650c6b0975bdb67d132774.zip |
No duplicate address book if shared with user and group and the user is part of the group
Diffstat (limited to 'apps/dav/lib')
-rw-r--r-- | apps/dav/lib/carddav/carddavbackend.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/dav/lib/carddav/carddavbackend.php b/apps/dav/lib/carddav/carddavbackend.php index 025d46ecdee..d490bdb91ec 100644 --- a/apps/dav/lib/carddav/carddavbackend.php +++ b/apps/dav/lib/carddav/carddavbackend.php @@ -103,7 +103,7 @@ class CardDavBackend implements BackendInterface, SyncSupport { $result = $query->execute(); while($row = $result->fetch()) { - $addressBooks[] = [ + $addressBooks[$row['id']] = [ 'id' => $row['id'], 'uri' => $row['uri'], 'principaluri' => $row['principaluri'], @@ -133,7 +133,7 @@ class CardDavBackend implements BackendInterface, SyncSupport { list(, $name) = URLUtil::splitPath($row['principaluri']); $uri = $row['uri'] . '_shared_by_' . $name; $displayName = $row['displayname'] . "($name)"; - $addressBooks[] = [ + $addressBooks[$row['id']] = [ 'id' => $row['id'], 'uri' => $uri, 'principaluri' => $principalUri, @@ -147,7 +147,7 @@ class CardDavBackend implements BackendInterface, SyncSupport { } $result->closeCursor(); - return $addressBooks; + return array_values($addressBooks); } /** |