diff options
author | Aragon Gouveia <aragon@phat.za.net> | 2022-01-03 15:52:09 +0200 |
---|---|---|
committer | John Molakvoæ <skjnldsv@users.noreply.github.com> | 2024-02-23 14:43:31 +0100 |
commit | 311d1d2306f24f9c2b38d2d8b6911d05440e28d5 (patch) | |
tree | 8d4c61a61fd3dc77d7351db7f8e5180af9cbd87d /apps/files_sharing/lib/Controller/ShareAPIController.php | |
parent | fa773ece6dac48ed4ff15b51341eec31c2b13052 (diff) | |
download | nextcloud-server-311d1d2306f24f9c2b38d2d8b6911d05440e28d5.tar.gz nextcloud-server-311d1d2306f24f9c2b38d2d8b6911d05440e28d5.zip |
fix truncated circleId returned from Share API
Diffstat (limited to 'apps/files_sharing/lib/Controller/ShareAPIController.php')
-rw-r--r-- | apps/files_sharing/lib/Controller/ShareAPIController.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/apps/files_sharing/lib/Controller/ShareAPIController.php b/apps/files_sharing/lib/Controller/ShareAPIController.php index 71d21cfb55c..5bb1581b6ab 100644 --- a/apps/files_sharing/lib/Controller/ShareAPIController.php +++ b/apps/files_sharing/lib/Controller/ShareAPIController.php @@ -310,10 +310,11 @@ class ShareAPIController extends OCSController { $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'] = ''; |