diff --git a/lib/private/files/fileinfo.php b/lib/private/files/fileinfo.php index 8e9b6a8b72..b80873d1d0 100644 --- a/lib/private/files/fileinfo.php +++ b/lib/private/files/fileinfo.php @@ -146,4 +146,8 @@ class FileInfo implements \OCP\Files\FileInfo, \ArrayAccess, \JsonSerializable { public function getType() { return $this->data['type']; } + + public function getData(){ + return $this->data; + } } diff --git a/lib/private/files/view.php b/lib/private/files/view.php index 39c2ffed93..b587027966 100644 --- a/lib/private/files/view.php +++ b/lib/private/files/view.php @@ -963,12 +963,15 @@ class View { * change file metadata * * @param string $path - * @param array $data + * @param array | \OCP\Files\FileInfo $data * @return int * * returns the fileid of the updated file */ public function putFileInfo($path, $data) { + if ($data instanceof FileInfo) { + $data = $data->getData(); + } $path = Filesystem::normalizePath($this->fakeRoot . '/' . $path); /** * @var \OC\Files\Storage\Storage $storage