Skip to content

Commit

Permalink
fix truncated circleId returned from Share API
Browse files Browse the repository at this point in the history
  • Loading branch information
jmptbl authored and skjnldsv committed Feb 23, 2024
1 parent fa773ec commit 311d1d2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions apps/files_sharing/lib/Controller/ShareAPIController.php
Original file line number Diff line number Diff line change
Expand Up @@ -310,10 +310,11 @@ protected function formatShare(IShare $share, Node $recipientNode = null): array

$shareWithStart = ($hasCircleId ? strrpos($share->getSharedWith(), '[') + 1 : 0);
$shareWithLength = ($hasCircleId ? -1 : strpos($share->getSharedWith(), ' '));
if (is_bool($shareWithLength)) {
$shareWithLength = -1;
if ($shareWithLength === false) {
$result['share_with'] = substr($share->getSharedWith(), $shareWithStart);
} else {
$result['share_with'] = substr($share->getSharedWith(), $shareWithStart, $shareWithLength);
}
$result['share_with'] = substr($share->getSharedWith(), $shareWithStart, $shareWithLength);
} elseif ($share->getShareType() === IShare::TYPE_ROOM) {
$result['share_with'] = $share->getSharedWith();
$result['share_with_displayname'] = '';
Expand Down

0 comments on commit 311d1d2

Please sign in to comment.