mirror of
https://github.com/nextcloud/server.git
synced 2026-06-09 08:44:07 -04:00
Contacts: Check format parameter
This commit is contained in:
parent
6d971d3b1d
commit
6a95e4288e
1 changed files with 8 additions and 6 deletions
|
|
@ -68,11 +68,13 @@ class OC_Share_Backend_Addressbook implements OCP\Share_Backend_Collection {
|
|||
*/
|
||||
public function formatItems($items, $format, $parameters = null) {
|
||||
$addressbooks = array();
|
||||
foreach ($items as $item) {
|
||||
$addressbook = OC_Contacts_Addressbook::find($item['item_source']);
|
||||
if ($addressbook) {
|
||||
$addressbook['displayname'] = $item['item_target'];
|
||||
$addressbooks[] = $addressbook;
|
||||
if ($format == self::FORMAT_ADDRESSBOOKS) {
|
||||
foreach ($items as $item) {
|
||||
$addressbook = OC_Contacts_Addressbook::find($item['item_source']);
|
||||
if ($addressbook) {
|
||||
$addressbook['displayname'] = $item['item_target'];
|
||||
$addressbooks[] = $addressbook;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $addressbooks;
|
||||
|
|
@ -88,4 +90,4 @@ class OC_Share_Backend_Addressbook implements OCP\Share_Backend_Collection {
|
|||
return $sources;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue