diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2020-06-04 19:01:56 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-04 19:01:56 +0200 |
commit | a1204be15baaa00a073107c36c722a5a090d4699 (patch) | |
tree | 57293cb5eda9d960ed44e6237a82a5694816f721 /lib | |
parent | c296a55fe81e6625ba92c4b818af614664368a13 (diff) | |
parent | 982f2fc21abdc5adb40d07609f1b9c68b232d137 (diff) | |
download | nextcloud-server-a1204be15baaa00a073107c36c722a5a090d4699.tar.gz nextcloud-server-a1204be15baaa00a073107c36c722a5a090d4699.zip |
Merge pull request #21226 from nextcloud/backport/21199/stable19
[stable19] Prevent harder to share your root
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Share20/Manager.php | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/private/Share20/Manager.php b/lib/private/Share20/Manager.php index cbc456a9740..04093278694 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'); } |