summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Steinmetz <richard@steinmetz.cloud>2023-01-18 12:10:49 +0100
committerbackportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com>2023-01-26 13:45:46 +0000
commit6728b4b30b204f8e1e9fc6f663d7ac35d770af1f (patch)
treeed3d04f0db1b1eb44aaac49ad6fd95610a558848
parentfb3261a062c0b63d826ec6bc5548505380fd189f (diff)
downloadnextcloud-server-6728b4b30b204f8e1e9fc6f663d7ac35d770af1f.tar.gz
nextcloud-server-6728b4b30b204f8e1e9fc6f663d7ac35d770af1f.zip
fix(dav): check if principal has email address before accessing it
Ref https://github.com/nextcloud/calendar/issues/4811 Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
-rw-r--r--apps/dav/lib/Connector/Sabre/Principal.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/dav/lib/Connector/Sabre/Principal.php b/apps/dav/lib/Connector/Sabre/Principal.php
index c1ad2535936..2a110e928ad 100644
--- a/apps/dav/lib/Connector/Sabre/Principal.php
+++ b/apps/dav/lib/Connector/Sabre/Principal.php
@@ -601,8 +601,8 @@ class Principal implements BackendInterface {
public function getEmailAddressesOfPrincipal(array $principal): array {
$emailAddresses = [];
- if (($primaryAddress = $principal['{http://sabredav.org/ns}email-address'])) {
- $emailAddresses[] = $primaryAddress;
+ if (isset($principal['{http://sabredav.org/ns}email-address'])) {
+ $emailAddresses[] = $principal['{http://sabredav.org/ns}email-address'];
}
if (isset($principal['{DAV:}alternate-URI-set'])) {