aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2025-04-10 16:58:23 +0200
committerRobin Appelman <robin@icewind.nl>2025-04-10 16:58:23 +0200
commitcf851a390157c55f63276c9b35de50a84d819325 (patch)
tree36ecdf7641779c9dc5450fc47581fc01d8e71fa6
parent9e0e53707f02c455bb5998130d0556ade7ca298f (diff)
downloadnextcloud-server-targetIsNotShared-catch-notfound.tar.gz
nextcloud-server-targetIsNotShared-catch-notfound.zip
fix: handle shares for which the source is deleted when checking if rename target is sharedtargetIsNotShared-catch-notfound
Signed-off-by: Robin Appelman <robin@icewind.nl>
-rw-r--r--lib/private/Files/View.php16
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php
index bbad24d3e43..f6ca2b09d0f 100644
--- a/lib/private/Files/View.php
+++ b/lib/private/Files/View.php
@@ -1893,12 +1893,16 @@ class View {
}, $providers));
foreach ($shares as $share) {
- $sharedPath = $share->getNode()->getPath();
- if ($targetPath === $sharedPath || str_starts_with($targetPath, $sharedPath . '/')) {
- $this->logger->debug(
- 'It is not allowed to move one mount point into a shared folder',
- ['app' => 'files']);
- return false;
+ try {
+ $sharedPath = $share->getNode()->getPath();
+ if ($targetPath === $sharedPath || str_starts_with($targetPath, $sharedPath . '/')) {
+ $this->logger->debug(
+ 'It is not allowed to move one mount point into a shared folder',
+ ['app' => 'files']);
+ return false;
+ }
+ } catch (NotFoundException $e) {
+ // ignore
}
}