summaryrefslogtreecommitdiffstats
path: root/apps/dav/lib/CardDAV/CardDavBackend.php
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2018-10-30 13:03:49 +0100
committerMorris Jobke <hey@morrisjobke.de>2018-11-01 15:02:50 +0100
commitd89edb28c4218eeadc5c2c5bbea6253dfc599a5f (patch)
treee01ab8d131f5d66c0b8f6bf94b456390ac6cdfc6 /apps/dav/lib/CardDAV/CardDavBackend.php
parent644686c0ec74f619a42c5274cd8422861df97127 (diff)
downloadnextcloud-server-d89edb28c4218eeadc5c2c5bbea6253dfc599a5f.tar.gz
nextcloud-server-d89edb28c4218eeadc5c2c5bbea6253dfc599a5f.zip
move migration
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/dav/lib/CardDAV/CardDavBackend.php')
-rw-r--r--apps/dav/lib/CardDAV/CardDavBackend.php15
1 files changed, 13 insertions, 2 deletions
diff --git a/apps/dav/lib/CardDAV/CardDavBackend.php b/apps/dav/lib/CardDAV/CardDavBackend.php
index a9d65f2f0f9..8ef0e0baf56 100644
--- a/apps/dav/lib/CardDAV/CardDavBackend.php
+++ b/apps/dav/lib/CardDAV/CardDavBackend.php
@@ -1130,9 +1130,20 @@ class CardDavBackend implements BackendInterface, SyncSupport {
}
}
+ /**
+ * Extract UID from vcard
+ *
+ * @param string $cardData the vcard raw data
+ * @return string the uid or empty if none
+ * @throws BadRequest
+ */
private function getUID($cardData) {
$vCard = Reader::read($cardData);
- $uid = $vCard->UID->getValue();
- return $uid;
+ if ($vCard->UID) {
+ $uid = $vCard->UID->getValue();
+ return $uid;
+ }
+ // should already be handled, but just in case
+ throw new BadRequest('vCards on CardDAV servers MUST have a UID property');
}
}