From 648c8df51645147f99fd687511003062ae01978c Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 12 Mar 2020 11:26:31 +0100 Subject: Don't populate the PHOTO property when it's not an image Signed-off-by: Joas Schilling --- apps/dav/lib/CardDAV/HasPhotoPlugin.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'apps/dav/lib/CardDAV/HasPhotoPlugin.php') diff --git a/apps/dav/lib/CardDAV/HasPhotoPlugin.php b/apps/dav/lib/CardDAV/HasPhotoPlugin.php index bb847e74a37..cf9d68e14a4 100644 --- a/apps/dav/lib/CardDAV/HasPhotoPlugin.php +++ b/apps/dav/lib/CardDAV/HasPhotoPlugin.php @@ -62,7 +62,12 @@ class HasPhotoPlugin extends ServerPlugin { if ($node instanceof Card) { $propFind->handle($ns . 'has-photo', function () use ($node) { $vcard = Reader::read($node->get()); - return ($vcard instanceof VCard && $vcard->PHOTO); + return $vcard instanceof VCard + && $vcard->PHOTO + // Either the PHOTO is a url (doesn't start with data:) or the mimetype has to start with image/ + && (strpos($vcard->PHOTO->getValue(), 'data:') !== 0 + || strpos($vcard->PHOTO->getValue(), 'data:image/') === 0) + ; }); } } -- cgit v1.2.3