Merge pull request #24152 from nextcloud/backport/24098/stable18

[stable18] circleId too short in some request
This commit is contained in:
Morris Jobke 2020-12-01 14:11:56 +01:00 committed by GitHub
commit 5511fb2bf6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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) {