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

Use correct method to extract image from vcard

It was incorrectly assumed, that $vcard is always an
OCA\Contacts\Contact (which is true when the contacts app is rendered)
but when called from the `contactUpdated` hook, it actually is a
OCA\Contacts\VObject\VCard.

Fixes owncloud/contacts#585
This commit is contained in:
Felix Eckhofer 2014-08-10 20:16:52 +02:00 committed by dirdi
parent b1df56c875
commit 6d0a8ad997

View File

@ -311,8 +311,8 @@ Class Properties {
$app = new App();
$vcard = $app->getContact($backendName, $addressBookId, $contactId);
}
$image = $vcard->getPhoto();
if (is_null($image)) {
$image = new \OCP\Image();
if (!isset($vcard->PHOTO) || !$image->loadFromBase64((string)$vcard->PHOTO)) {
return false;
}
}