summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2012-08-10 14:33:20 +0200
committerBart Visscher <bartv@thisnet.nl>2012-08-10 14:40:43 +0200
commit6a95e4288ed4987453719c1bb87056ae822a4b73 (patch)
tree22ed1bc348e5cc7a329d06fd238bb60281c2c5ba /apps
parent6d971d3b1d97e872751c2e5a1cc90c8392de8186 (diff)
downloadnextcloud-server-6a95e4288ed4987453719c1bb87056ae822a4b73.tar.gz
nextcloud-server-6a95e4288ed4987453719c1bb87056ae822a4b73.zip
Contacts: Check format parameter
Diffstat (limited to 'apps')
-rw-r--r--apps/contacts/lib/share/addressbook.php14
1 files changed, 8 insertions, 6 deletions
diff --git a/apps/contacts/lib/share/addressbook.php b/apps/contacts/lib/share/addressbook.php
index d90700d769f..62799696d95 100644
--- a/apps/contacts/lib/share/addressbook.php
+++ b/apps/contacts/lib/share/addressbook.php
@@ -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;
}
-} \ No newline at end of file
+}