diff options
author | blizzz <blizzz@arthur-schiwon.de> | 2022-04-22 15:34:13 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-22 15:34:13 +0300 |
commit | efde83e07f3d5474326334008755cba4b13fa6ee (patch) | |
tree | a9c8a737fb27e430e0ab1db42c18b28297cf679b | |
parent | b9bfd5aba8f994d13720307a0a46e76d32184e02 (diff) | |
parent | 8fc44d24eb532c2068f84900aafe20a438952663 (diff) |
Merge pull request #32046 from nextcloud/backport/32042/stable24
[stable24] improve optimization for SharedStorage::instanceOfStorage(Common)
-rw-r--r-- | apps/files_sharing/lib/SharedStorage.php | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/apps/files_sharing/lib/SharedStorage.php b/apps/files_sharing/lib/SharedStorage.php index 6a342f0bdbf..8d123e7b873 100644 --- a/apps/files_sharing/lib/SharedStorage.php +++ b/apps/files_sharing/lib/SharedStorage.php @@ -35,7 +35,11 @@ namespace OCA\Files_Sharing; use OC\Files\Cache\FailedCache; use OC\Files\Cache\NullWatcher; use OC\Files\Cache\Watcher; +use OC\Files\ObjectStore\HomeObjectStoreStorage; +use OC\Files\Storage\Common; +use OC\Files\Storage\Home; use OCP\Files\Folder; +use OCP\Files\IHomeStorage; use OCP\Files\Node; use OC\Files\Storage\FailedStorage; use OC\Files\Storage\Wrapper\PermissionsMask; @@ -182,10 +186,17 @@ class SharedStorage extends \OC\Files\Storage\Wrapper\Jail implements ISharedSto * @inheritdoc */ public function instanceOfStorage($class): bool { - if ($class === '\OC\Files\Storage\Common') { + if ($class === '\OC\Files\Storage\Common' || $class == Common::class) { return true; } - if (in_array($class, ['\OC\Files\Storage\Home', '\OC\Files\ObjectStore\HomeObjectStoreStorage', '\OCP\Files\IHomeStorage'])) { + if (in_array($class, [ + '\OC\Files\Storage\Home', + '\OC\Files\ObjectStore\HomeObjectStoreStorage', + '\OCP\Files\IHomeStorage', + Home::class, + HomeObjectStoreStorage::class, + IHomeStorage::class + ])) { return false; } return parent::instanceOfStorage($class); |