diff options
author | Jakob Sack <kde@jakobsack.de> | 2011-09-17 00:26:57 +0200 |
---|---|---|
committer | Jakob Sack <kde@jakobsack.de> | 2011-09-17 00:26:57 +0200 |
commit | 54a3b28dce8ed0185d504e9c16d068a852d8a7b3 (patch) | |
tree | 75515cc758aad46a1a680a763f76c169b6b51897 /apps/contacts/photo.php | |
parent | 2a84f7f07c58b92b5c2293e0936fd3aec9e8f616 (diff) | |
download | nextcloud-server-54a3b28dce8ed0185d504e9c16d068a852d8a7b3.tar.gz nextcloud-server-54a3b28dce8ed0185d504e9c16d068a852d8a7b3.zip |
Split OC_Contacts_Addressbook in _Addressbook and _VCard
Diffstat (limited to 'apps/contacts/photo.php')
-rw-r--r-- | apps/contacts/photo.php | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/apps/contacts/photo.php b/apps/contacts/photo.php index 62386421cdc..ac49d6c31a8 100644 --- a/apps/contacts/photo.php +++ b/apps/contacts/photo.php @@ -34,20 +34,25 @@ if( !OC_User::isLoggedIn()){ } -$card = OC_Contacts_Addressbook::findCard( $id ); +$card = OC_Contacts_VCard::find( $id ); if( $card === false ){ echo $l10n->t('Can not find Contact!'); exit(); } -$addressbook = OC_Contacts_Addressbook::findAddressbook( $card['addressbookid'] ); +$addressbook = OC_Contacts_Addressbook::find( $card['addressbookid'] ); if( $addressbook === false || $addressbook['userid'] != OC_USER::getUser()){ echo $l10n->t('This is not your contact!'); exit(); } -$content = Sabre_VObject_Reader::read($card['carddata']); +$content = OC_Contacts_Card::parse($card['carddata']); +// invalid vcard +if( is_null($content)){ + echo $l10n->t('This card is not RFC compatible!'); + exit(); +} // Photo :-) foreach($content->children as $child){ if($child->name == 'PHOTO'){ |