summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@owncloud.com>2015-01-14 13:51:41 +0100
committerAndreas Fischer <bantu@owncloud.com>2015-01-15 00:48:10 +0100
commitb4a52e889a588928cb2fc99c1ddcf63b60096a32 (patch)
tree01ac366fab6a49eb4bccfa446a7d1b15c1323f80
parent3a6d2fcc102a7e9c62a2233ccc50691470741337 (diff)
downloadnextcloud-server-b4a52e889a588928cb2fc99c1ddcf63b60096a32.tar.gz
nextcloud-server-b4a52e889a588928cb2fc99c1ddcf63b60096a32.zip
Do not use key() on array as the result depends on the internal array pointer.
-rw-r--r--apps/files_sharing/lib/share/file.php11
1 files changed, 6 insertions, 5 deletions
diff --git a/apps/files_sharing/lib/share/file.php b/apps/files_sharing/lib/share/file.php
index 1d7eb77f7cf..dae859781e2 100644
--- a/apps/files_sharing/lib/share/file.php
+++ b/apps/files_sharing/lib/share/file.php
@@ -96,12 +96,13 @@ class OC_Share_Backend_File implements OCP\Share_Backend_File_Dependent {
public function formatItems($items, $format, $parameters = null) {
if ($format == self::FORMAT_SHARED_STORAGE) {
// Only 1 item should come through for this format call
+ $item = array_shift($items);
return array(
- 'parent' => $items[key($items)]['parent'],
- 'path' => $items[key($items)]['path'],
- 'storage' => $items[key($items)]['storage'],
- 'permissions' => $items[key($items)]['permissions'],
- 'uid_owner' => $items[key($items)]['uid_owner'],
+ 'parent' => $item['parent'],
+ 'path' => $item['path'],
+ 'storage' => $item['storage'],
+ 'permissions' => $item['permissions'],
+ 'uid_owner' => $item['uid_owner'],
);
} else if ($format == self::FORMAT_GET_FOLDER_CONTENTS) {
$files = array();