diff options
author | Andrew Summers <18727110+summersab@users.noreply.github.com> | 2023-08-29 18:50:12 -0500 |
---|---|---|
committer | Git'Fellow <12234510+solracsf@users.noreply.github.com> | 2023-11-10 16:51:05 +0100 |
commit | 40edb426a3a6857598ff3f447a85e83e32ff0c32 (patch) | |
tree | f079cb61f5ae5d4d8eb127273512a4e8911fed01 /lib/private/legacy/OC_Files.php | |
parent | 1d9c482e689a474be8f4010a9a898f16e7a5ae25 (diff) | |
download | nextcloud-server-40edb426a3a6857598ff3f447a85e83e32ff0c32.tar.gz nextcloud-server-40edb426a3a6857598ff3f447a85e83e32ff0c32.zip |
Refactor `OC\Server::getRootFolder`
Signed-off-by: Andrew Summers <18727110+summersab@users.noreply.github.com>
Diffstat (limited to 'lib/private/legacy/OC_Files.php')
-rw-r--r-- | lib/private/legacy/OC_Files.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/private/legacy/OC_Files.php b/lib/private/legacy/OC_Files.php index ac0a2bbd0e9..ee3be30948b 100644 --- a/lib/private/legacy/OC_Files.php +++ b/lib/private/legacy/OC_Files.php @@ -46,6 +46,7 @@ use OC\Streamer; use OCP\Lock\ILockingProvider; use OCP\Files\Events\BeforeZipCreatedEvent; use OCP\Files\Events\BeforeDirectFileDownloadEvent; +use OCP\Files\IRootFolder; use OCP\EventDispatcher\IEventDispatcher; /** @@ -187,7 +188,7 @@ class OC_Files { foreach ($files as $file) { $file = $dir . '/' . $file; if (\OC\Files\Filesystem::is_file($file)) { - $userFolder = \OC::$server->getRootFolder()->get(\OC\Files\Filesystem::getRoot()); + $userFolder = \OC::$server->get(IRootFolder::class)->get(\OC\Files\Filesystem::getRoot()); $file = $userFolder->get($file); if ($file instanceof \OC\Files\Node\File) { try { @@ -307,7 +308,7 @@ class OC_Files { $file = null; try { - $userFolder = \OC::$server->getRootFolder()->get(\OC\Files\Filesystem::getRoot()); + $userFolder = \OC::$server->get(IRootFolder::class)->get(\OC\Files\Filesystem::getRoot()); $file = $userFolder->get($filename); if (!$file instanceof \OC\Files\Node\File || !$file->isReadable()) { http_response_code(403); |