1
0
mirror of https://github.com/owncloudarchive/contacts.git synced 2024-12-01 13:24:10 +01:00

Contacts: Check format parameter

This commit is contained in:
Bart Visscher 2012-08-10 14:33:20 +02:00
parent fe8bae5b1e
commit 8679aa2699

View File

@ -68,11 +68,13 @@ class OC_Share_Backend_Addressbook implements OCP\Share_Backend_Collection {
*/ */
public function formatItems($items, $format, $parameters = null) { public function formatItems($items, $format, $parameters = null) {
$addressbooks = array(); $addressbooks = array();
foreach ($items as $item) { if ($format == self::FORMAT_ADDRESSBOOKS) {
$addressbook = OC_Contacts_Addressbook::find($item['item_source']); foreach ($items as $item) {
if ($addressbook) { $addressbook = OC_Contacts_Addressbook::find($item['item_source']);
$addressbook['displayname'] = $item['item_target']; if ($addressbook) {
$addressbooks[] = $addressbook; $addressbook['displayname'] = $item['item_target'];
$addressbooks[] = $addressbook;
}
} }
} }
return $addressbooks; return $addressbooks;