Skip to content

Commit 5511fb2

Browse files
authored
Merge pull request #24152 from nextcloud/backport/24098/stable18
[stable18] circleId too short in some request
2 parents ec2ac55 + 7deddf3 commit 5511fb2

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

apps/files_sharing/lib/Controller/ShareAPIController.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1609,10 +1609,11 @@ private function shareProviderResharingRights(string $userId, IShare $share, $no
16091609
$hasCircleId = (substr($share->getSharedWith(), -1) === ']');
16101610
$shareWithStart = ($hasCircleId ? strrpos($share->getSharedWith(), '[') + 1 : 0);
16111611
$shareWithLength = ($hasCircleId ? -1 : strpos($share->getSharedWith(), ' '));
1612-
if (is_bool($shareWithLength)) {
1613-
$shareWithLength = -1;
1612+
if ($shareWithLength === false) {
1613+
$sharedWith = substr($share->getSharedWith(), $shareWithStart);
1614+
} else {
1615+
$sharedWith = substr($share->getSharedWith(), $shareWithStart, $shareWithLength);
16141616
}
1615-
$sharedWith = substr($share->getSharedWith(), $shareWithStart, $shareWithLength);
16161617
try {
16171618
$member = \OCA\Circles\Api\v1\Circles::getMember($sharedWith, $userId, 1);
16181619
if ($member->getLevel() >= 4) {

0 commit comments

Comments
 (0)