diff options
Diffstat (limited to 'apps/files_versions')
-rw-r--r-- | apps/files_versions/lib/storage.php | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/apps/files_versions/lib/storage.php b/apps/files_versions/lib/storage.php index 21b5e9e0e7b..e1312841653 100644 --- a/apps/files_versions/lib/storage.php +++ b/apps/files_versions/lib/storage.php @@ -41,6 +41,7 @@ namespace OCA\Files_Versions; +use OC\Files\Filesystem; use OCA\Files_Versions\AppInfo\Application; use OCA\Files_Versions\Command\Expire; use OCP\Lock\ILockingProvider; @@ -81,18 +82,7 @@ class Storage { * @throws \OC\User\NoUserException */ public static function getUidAndFilename($filename) { - $uid = \OC\Files\Filesystem::getOwner($filename); - \OC\Files\Filesystem::initMountPoints($uid); - if ( $uid != \OCP\User::getUser() ) { - $info = \OC\Files\Filesystem::getFileInfo($filename); - $ownerView = new \OC\Files\View('/'.$uid.'/files'); - try { - $filename = $ownerView->getPath($info['fileid']); - } catch (NotFoundException $e) { - $filename = null; - } - } - return [$uid, $filename]; + return Filesystem::getView()->getUidAndFilename($filename); } /** |