]> source.dussan.org Git - nextcloud-server.git/commitdiff
In some cases $contact['CLOUD'] is not an array
authorThomas Müller <thomas.mueller@tmit.eu>
Thu, 28 Jan 2016 15:01:34 +0000 (16:01 +0100)
committerThomas Müller <thomas.mueller@tmit.eu>
Tue, 2 Feb 2016 09:56:33 +0000 (10:56 +0100)
apps/files_sharing/api/sharees.php

index d23a6f56501e7b1ba9db453e9d6694b229884907..c6bef8d784de5f06339946387941db1340b53826 100644 (file)
@@ -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;