Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'apps/dav/lib/CardDAV/HasPhotoPlugin.php')
-rw-r--r--apps/dav/lib/CardDAV/HasPhotoPlugin.php7
1 files changed, 6 insertions, 1 deletions
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)
+ ;
});
}
}