aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/lib/Controller
diff options
context:
space:
mode:
authorwaleczny <michal@walczak.xyz>2019-11-18 23:33:26 +0100
committerGitHub <noreply@github.com>2019-11-18 23:33:26 +0100
commit6e3ea09b1cc736060dda312ae03ae5194286d0a2 (patch)
tree88a19eeae432f27129504d5003439cf1cd39aeab /apps/files_sharing/lib/Controller
parent5195be108f1f6bc90d0413cf732361e64982f001 (diff)
downloadnextcloud-server-6e3ea09b1cc736060dda312ae03ae5194286d0a2.tar.gz
nextcloud-server-6e3ea09b1cc736060dda312ae03ae5194286d0a2.zip
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.
Diffstat (limited to 'apps/files_sharing/lib/Controller')
-rw-r--r--apps/files_sharing/lib/Controller/ShareAPIController.php2
1 files changed, 1 insertions, 1 deletions
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);
}
}