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.
This commit is contained in:
Robin McCorkell 2015-01-15 01:06:45 +00:00
commit 9d0915013b
1 changed files with 6 additions and 5 deletions

View File

@ -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();