Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion apps/dav/lib/CardDAV/Converter.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,14 @@ public function createCardFromUser(IUser $user): ?VCard {
$userProperties = $this->accountManager->getAccount($user)->getProperties();

$uid = $user->getUID();
$backendClassName = $user->getBackendClassName();
$cloudId = $user->getCloudId();
$image = $this->getAvatarImage($user);

$vCard = new VCard();
$vCard->VERSION = '3.0';
$vCard->UID = $uid;
$vCard->UID = md5("$backendClassName:$uid");
$vCard->add(new Text($vCard, 'X-NEXTCLOUD-UID', $uid));

$publish = false;

Expand Down
2 changes: 1 addition & 1 deletion apps/dav/lib/CardDAV/SyncService.php
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ public function syncInstance(\Closure $progressCallback = null) {
$allCards = $this->backend->getCards($systemAddressBook['id']);
foreach ($allCards as $card) {
$vCard = Reader::read($card['carddata']);
$uid = $vCard->UID->getValue();
$uid = isset($vCard->{'X-NEXTCLOUD-UID'}) ? $vCard->{'X-NEXTCLOUD-UID'}->getValue() : $vCard->UID->getValue();

Check notice

Code scanning / Psalm

PossiblyNullReference

Cannot call method getValue on possibly null value
// load backend and see if user exists
if (!$this->userManager->userExists($uid)) {
$this->deleteUser($card['uri']);
Expand Down