Merge pull request #24196 from nextcloud/backport/24098/stable20
[stable20] circleId too short in some request
This commit is contained in:
commit
2c5a1fd636
|
@ -1648,10 +1648,11 @@ 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 (is_bool($shareWithLength)) {
|
if ($shareWithLength === false) {
|
||||||
$shareWithLength = -1;
|
$sharedWith = substr($share->getSharedWith(), $shareWithStart);
|
||||||
|
} 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) {
|
||||||
|
|
Loading…
Reference in New Issue