From 847b1e3af0f4f76dd8d3fc683019a6de56c16957 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Thomas=20M=C3=BCller?= Date: Thu, 28 Jan 2016 16:01:34 +0100 Subject: [PATCH] In some cases $contact['CLOUD'] is not an array --- apps/files_sharing/api/sharees.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/files_sharing/api/sharees.php b/apps/files_sharing/api/sharees.php index d23a6f56501..c6bef8d784d 100644 --- a/apps/files_sharing/api/sharees.php +++ b/apps/files_sharing/api/sharees.php @@ -271,7 +271,11 @@ class Sharees { $foundRemoteById = false; foreach ($addressBookContacts as $contact) { if (isset($contact['CLOUD'])) { - foreach ($contact['CLOUD'] as $cloudId) { + $cloudIds = $contact['CLOUD']; + if (!is_array($cloudIds)) { + $cloudIds = [$cloudIds]; + } + foreach ($cloudIds as $cloudId) { if (strtolower($contact['FN']) === $search || strtolower($cloudId) === $search) { if (strtolower($cloudId) === $search) { $foundRemoteById = true; -- 2.39.5