From c97c906c90faa365a2c8b5b290d5896bd3451fd3 Mon Sep 17 00:00:00 2001 From: "Francisco Blas Izquierdo Riera (klondike)" Date: Sat, 2 Sep 2023 00:47:07 +0200 Subject: [PATCH] Fix sharing and around three errors related to Undefined array key "CLOUD" We try to access $contact['CLOUD'] when it might not be set. As a consequence of that 3 PHP errors are generated the last one being an uncaught exception that makes it impossible to share files locally. This patch adds a simple check to ensure the value exists before using it. Signed-off-by: Francisco Blas Izquierdo Riera (klondike) --- lib/private/Collaboration/Collaborators/MailPlugin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/private/Collaboration/Collaborators/MailPlugin.php b/lib/private/Collaboration/Collaborators/MailPlugin.php index aa317ec17204f..27999bf933fc0 100644 --- a/lib/private/Collaboration/Collaborators/MailPlugin.php +++ b/lib/private/Collaboration/Collaborators/MailPlugin.php @@ -186,7 +186,7 @@ public function search($search, $limit, $offset, ISearchResult $searchResult) { return false; } - if ($this->shareeEnumeration) { + if ($this->shareeEnumeration && isset($contact['CLOUD'])) { try { $cloud = $this->cloudIdManager->resolveCloudId($contact['CLOUD'][0]); } catch (\InvalidArgumentException $e) {