diff options
Diffstat (limited to 'apps/files_sharing/lib/Updater.php')
-rw-r--r-- | apps/files_sharing/lib/Updater.php | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/apps/files_sharing/lib/Updater.php b/apps/files_sharing/lib/Updater.php index 226cf3e7fd4..24e82330d43 100644 --- a/apps/files_sharing/lib/Updater.php +++ b/apps/files_sharing/lib/Updater.php @@ -1,4 +1,5 @@ <?php + /** * SPDX-FileCopyrightText: 2018-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -11,6 +12,7 @@ use OC\Files\Filesystem; use OC\Files\Mount\MountPoint; use OCP\Constants; use OCP\Files\Folder; +use OCP\Files\Mount\IMountManager; use OCP\Server; use OCP\Share\IShare; @@ -48,7 +50,7 @@ class Updater { $src = $userFolder->get($path); - $shareManager = \OC::$server->getShareManager(); + $shareManager = Server::get(\OCP\Share\IManager::class); // We intentionally include invalid shares, as they have been automatically invalidated due to the node no longer // being accessible for the user. Only in this case where we adjust the share after it was moved we want to ignore @@ -74,8 +76,8 @@ class Updater { foreach ($subShares as $subShare) { $shareCacheEntry = $shareSources[$subShare->getNodeId()] ?? null; if ( - $shareCacheEntry && - str_starts_with($shareCacheEntry->getPath(), $sourceInternalPath . '/') + $shareCacheEntry + && str_starts_with($shareCacheEntry->getPath(), $sourceInternalPath . '/') ) { $shares[] = $subShare; } @@ -88,15 +90,15 @@ class Updater { } // Check if the destination is inside a share - $mountManager = \OC::$server->getMountManager(); + $mountManager = Server::get(IMountManager::class); $dstMount = $mountManager->find($src->getPath()); //Ownership is moved over foreach ($shares as $share) { if ( - $share->getShareType() !== IShare::TYPE_USER && - $share->getShareType() !== IShare::TYPE_GROUP && - $share->getShareType() !== IShare::TYPE_ROOM + $share->getShareType() !== IShare::TYPE_USER + && $share->getShareType() !== IShare::TYPE_GROUP + && $share->getShareType() !== IShare::TYPE_ROOM ) { continue; } |