diff options
author | Christoph Wurst <ChristophWurst@users.noreply.github.com> | 2020-11-18 10:53:02 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-18 10:53:02 +0300 |
commit | 0d33166c3f61234f9a291e9d2b85acc9493718de (patch) | |
tree | 6327d5dad52bdd968536a1bbb1f3dbab7611ed8c | |
parent | c03db79569f7c7240ddf912c48d034d1cee764d9 (diff) |
Revert "Revert "[stable20] circleId too short in some request""revert-24183-revert-24178-backport/24098/stable20
-rw-r--r-- | apps/files_sharing/lib/Controller/ShareAPIController.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/apps/files_sharing/lib/Controller/ShareAPIController.php b/apps/files_sharing/lib/Controller/ShareAPIController.php index 2c2ec393d3f..aaca16b32e6 100644 --- a/apps/files_sharing/lib/Controller/ShareAPIController.php +++ b/apps/files_sharing/lib/Controller/ShareAPIController.php @@ -1648,10 +1648,11 @@ class ShareAPIController extends OCSController { $hasCircleId = (substr($share->getSharedWith(), -1) === ']'); $shareWithStart = ($hasCircleId ? strrpos($share->getSharedWith(), '[') + 1 : 0); $shareWithLength = ($hasCircleId ? -1 : strpos($share->getSharedWith(), ' ')); - if (is_bool($shareWithLength)) { - $shareWithLength = -1; + if ($shareWithLength === false) { + $sharedWith = substr($share->getSharedWith(), $shareWithStart); + } else { + $sharedWith = substr($share->getSharedWith(), $shareWithStart, $shareWithLength); } - $sharedWith = substr($share->getSharedWith(), $shareWithStart, $shareWithLength); try { $member = \OCA\Circles\Api\v1\Circles::getMember($sharedWith, $userId, 1); if ($member->getLevel() >= 4) { |