diff options
author | Morris Jobke <hey@morrisjobke.de> | 2020-12-01 16:11:56 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-01 16:11:56 +0300 |
commit | 5511fb2bf6244d995cee8fa98bf61f5dabe10f0b (patch) | |
tree | a0e601dfd53f198e1a1f6e7385e8799dace46cf3 | |
parent | ec2ac5531a5f3cf51be4659efa6b732fdaba54fd (diff) | |
parent | 7deddf3ba995dde31622a41908fbc8ea6bd15a5a (diff) |
Merge pull request #24152 from nextcloud/backport/24098/stable18
[stable18] 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 39cfe7c6659..de07a511d18 100644 --- a/apps/files_sharing/lib/Controller/ShareAPIController.php +++ b/apps/files_sharing/lib/Controller/ShareAPIController.php @@ -1609,10 +1609,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) { |