summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJoas Schilling <213943+nickvergessen@users.noreply.github.com>2020-06-04 10:59:22 +0200
committerGitHub <noreply@github.com>2020-06-04 10:59:22 +0200
commit59c1ff690a88482ecba170b6f9b7624fc8a18a76 (patch)
treed18a3df4ec809469c701de083f39e0911b6a81a0 /lib
parent7ef10b2f4851c987029c9fe05062272eebbf9e1b (diff)
parent69eda9c0f6a3f0128475cde8f9e021c71677c51d (diff)
downloadnextcloud-server-59c1ff690a88482ecba170b6f9b7624fc8a18a76.tar.gz
nextcloud-server-59c1ff690a88482ecba170b6f9b7624fc8a18a76.zip
Merge pull request #21199 from nextcloud/bugfix/noid/prevent-harder-sharing-your-root
Prevent harder to share your root
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Share20/Manager.php4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/private/Share20/Manager.php b/lib/private/Share20/Manager.php
index 86b34a4b9f0..3d7a274e662 100644
--- a/lib/private/Share20/Manager.php
+++ b/lib/private/Share20/Manager.php
@@ -277,12 +277,10 @@ class Manager implements IManager {
// And you can't share your rootfolder
if ($this->userManager->userExists($share->getSharedBy())) {
$userFolder = $this->rootFolder->getUserFolder($share->getSharedBy());
- $userFolderPath = $userFolder->getPath();
} else {
$userFolder = $this->rootFolder->getUserFolder($share->getShareOwner());
- $userFolderPath = $userFolder->getPath();
}
- if ($userFolderPath === $share->getNode()->getPath()) {
+ if ($userFolder->getId() === $share->getNode()->getId()) {
throw new \InvalidArgumentException('You can’t share your root folder');
}