From 6e3ea09b1cc736060dda312ae03ae5194286d0a2 Mon Sep 17 00:00:00 2001 From: waleczny Date: Mon, 18 Nov 2019 23:33:26 +0100 Subject: Get first element of nodes array Geting first element of nodes array instead of element with key 0. In some cases key 0 not exists in this array ie. when file is shared from group folder with member of this group who have no permission to read this file. --- apps/files_sharing/lib/Controller/ShareAPIController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apps') diff --git a/apps/files_sharing/lib/Controller/ShareAPIController.php b/apps/files_sharing/lib/Controller/ShareAPIController.php index 90a76e2223d..e7b9f5e6044 100644 --- a/apps/files_sharing/lib/Controller/ShareAPIController.php +++ b/apps/files_sharing/lib/Controller/ShareAPIController.php @@ -181,7 +181,7 @@ class ShareAPIController extends OCSController { throw new NotFoundException(); } } else { - $node = $nodes[0]; + $node = reset($nodes); } } -- cgit v1.2.3