summaryrefslogtreecommitdiffstats
path: root/apps/dav/lib/Connector
diff options
context:
space:
mode:
authorRichard Steinmetz <richard@steinmetz.cloud>2023-01-18 12:10:49 +0100
committerRichard Steinmetz <richard@steinmetz.cloud>2023-01-24 09:27:53 +0100
commitbbda231e18caede2899b045f34e02e139b038409 (patch)
treee2af9593f99cefa2ade3cb1642178b2caf4fa617 /apps/dav/lib/Connector
parentf867a2d65e825800d6bf1b685659677f6136ac5f (diff)
downloadnextcloud-server-bbda231e18caede2899b045f34e02e139b038409.tar.gz
nextcloud-server-bbda231e18caede2899b045f34e02e139b038409.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>
Diffstat (limited to 'apps/dav/lib/Connector')
-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 7b4b7090832..0a882288314 100644
--- a/apps/dav/lib/Connector/Sabre/Principal.php
+++ b/apps/dav/lib/Connector/Sabre/Principal.php
@@ -617,8 +617,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'])) {