aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2023-07-05 16:26:44 +0200
committerAndy Scherzinger <info@andy-scherzinger.de>2024-02-27 14:24:27 +0100
commitb3f529e64f1d481d857f7593d33748aa40110adc (patch)
treeba8ca9742ca6d3fd08325651104b65669852eca5
parent250084f8b913e326e20ccc60c86091beab0a6524 (diff)
downloadnextcloud-server-remove-non-accessible-shares.tar.gz
nextcloud-server-remove-non-accessible-shares.zip
remove no longer accessible sharesremove-non-accessible-shares
Signed-off-by: Robin Appelman <robin@icewind.nl>
-rw-r--r--apps/files_sharing/lib/SharedStorage.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/files_sharing/lib/SharedStorage.php b/apps/files_sharing/lib/SharedStorage.php
index 6b605a6eddb..f59f128781c 100644
--- a/apps/files_sharing/lib/SharedStorage.php
+++ b/apps/files_sharing/lib/SharedStorage.php
@@ -146,9 +146,7 @@ class SharedStorage extends \OC\Files\Storage\Wrapper\Jail implements ISharedSto
/** @var Node|false $ownerNode */
$ownerNode = current($ownerNodes);
if (!$ownerNode) {
- $this->storage = new FailedStorage(['exception' => new NotFoundException("File by id $sourceId not found")]);
- $this->cache = new FailedCache();
- $this->rootPath = '';
+ throw new NotFoundException("File by id $sourceId not found");
} else {
$this->nonMaskedStorage = $ownerNode->getStorage();
$this->sourcePath = $ownerNode->getPath();
@@ -163,6 +161,8 @@ class SharedStorage extends \OC\Files\Storage\Wrapper\Jail implements ISharedSto
$this->storage = new FailedStorage(['exception' => $e]);
$this->cache = new FailedCache();
$this->rootPath = '';
+ $this->logger->error("Share source no longer available, removing share", ['exception' => $e, 'app' => 'files_sharing']);
+ $this->unshareStorage();
} catch (NoUserException $e) {
// sharer user deleted, set FailedStorage
$this->storage = new FailedStorage(['exception' => $e]);