aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2020-06-03 09:29:19 +0200
committerJoas Schilling <coding@schilljs.com>2020-06-03 14:47:38 +0200
commit69eda9c0f6a3f0128475cde8f9e021c71677c51d (patch)
treec4d32503e5a0a12f2427273850e10ece8b1c80ef /lib
parent796b454021785ac5be8ffb99935e28f1abaaa171 (diff)
downloadnextcloud-server-69eda9c0f6a3f0128475cde8f9e021c71677c51d.tar.gz
nextcloud-server-69eda9c0f6a3f0128475cde8f9e021c71677c51d.zip
Prevent harder to share your root
Signed-off-by: Joas Schilling <coding@schilljs.com>
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');
}