diff options
author | Christoph Wurst <ChristophWurst@users.noreply.github.com> | 2020-11-17 13:32:20 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-17 13:32:20 +0100 |
commit | 8a710c88372511dcb68abab195771d2a9639061e (patch) | |
tree | f2638399bcda42a9a2892720fda2e799504bae0d | |
parent | ec4a2263428b6606c83357b70520a79f5f48e7e2 (diff) | |
parent | abb05a5b1f3c1db613ff64ee3ba294ac0fc81637 (diff) | |
download | nextcloud-server-8a710c88372511dcb68abab195771d2a9639061e.tar.gz nextcloud-server-8a710c88372511dcb68abab195771d2a9639061e.zip |
Merge pull request #24177 from nextcloud/backport/24098/stable19
[stable19] circleId too short in some request
-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 579391efc5c..cdbacafb751 100644 --- a/apps/files_sharing/lib/Controller/ShareAPIController.php +++ b/apps/files_sharing/lib/Controller/ShareAPIController.php @@ -1622,10 +1622,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) { |