summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/lib
diff options
context:
space:
mode:
authorRobin McCorkell <rmccorkell@karoshi.org.uk>2015-01-15 01:06:45 +0000
committerRobin McCorkell <rmccorkell@karoshi.org.uk>2015-01-15 01:06:45 +0000
commit9d0915013bb7f36d31670419610211a521a9cd48 (patch)
tree14f3a7927083a6a526bede5633e323f102e30dd6 /apps/files_sharing/lib
parent925a680a24c76587eadc5a699304f90625000659 (diff)
parentb4a52e889a588928cb2fc99c1ddcf63b60096a32 (diff)
downloadnextcloud-server-9d0915013bb7f36d31670419610211a521a9cd48.tar.gz
nextcloud-server-9d0915013bb7f36d31670419610211a521a9cd48.zip
Merge pull request #13352 from owncloud/hhvm-array-key
HHVM: Do not use key() on array as the result depends on the internal array pointer.
Diffstat (limited to 'apps/files_sharing/lib')
-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();