Merge pull request #24183 from nextcloud/revert-24178-backport/24098/stable20

Revert "[stable20] circleId too short in some request"
This commit is contained in:
Roeland Jago Douma 2020-11-17 21:53:22 +01:00 committed by GitHub
commit cc42b5e502
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 4 deletions

View File

@ -1648,11 +1648,10 @@ class ShareAPIController extends OCSController {
$hasCircleId = (substr($share->getSharedWith(), -1) === ']'); $hasCircleId = (substr($share->getSharedWith(), -1) === ']');
$shareWithStart = ($hasCircleId ? strrpos($share->getSharedWith(), '[') + 1 : 0); $shareWithStart = ($hasCircleId ? strrpos($share->getSharedWith(), '[') + 1 : 0);
$shareWithLength = ($hasCircleId ? -1 : strpos($share->getSharedWith(), ' ')); $shareWithLength = ($hasCircleId ? -1 : strpos($share->getSharedWith(), ' '));
if ($shareWithLength === false) { if (is_bool($shareWithLength)) {
$sharedWith = substr($share->getSharedWith(), $shareWithStart); $shareWithLength = -1;
} else {
$sharedWith = substr($share->getSharedWith(), $shareWithStart, $shareWithLength);
} }
$sharedWith = substr($share->getSharedWith(), $shareWithStart, $shareWithLength);
try { try {
$member = \OCA\Circles\Api\v1\Circles::getMember($sharedWith, $userId, 1); $member = \OCA\Circles\Api\v1\Circles::getMember($sharedWith, $userId, 1);
if ($member->getLevel() >= 4) { if ($member->getLevel() >= 4) {