diff options
author | Ferdinand Thiessen <opensource@fthiessen.de> | 2024-09-06 03:58:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-06 03:58:24 +0200 |
commit | 141fed839af0987157a35bb5e0f0e0f3a1501c55 (patch) | |
tree | a43591b17b2a3d489ebff217d6de85cc103a04b1 /lib | |
parent | e4fa9967014e99a70fcf0f45e84b35f610cedeb6 (diff) | |
parent | 0308001118462f5a6369fed313b844f631a43bcb (diff) | |
download | nextcloud-server-141fed839af0987157a35bb5e0f0e0f3a1501c55.tar.gz nextcloud-server-141fed839af0987157a35bb5e0f0e0f3a1501c55.zip |
Merge pull request #47756 from nextcloud/fixingPathShareCheck
fix(files): Check if target path is a descendant of the shared folder
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Files/View.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php index 2241bc02ae6..336349c680b 100644 --- a/lib/private/Files/View.php +++ b/lib/private/Files/View.php @@ -1794,7 +1794,8 @@ class View { }, $providers)); foreach ($shares as $share) { - if (str_starts_with($targetPath, $share->getNode()->getPath())) { + $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']); |