diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2020-11-19 10:09:41 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-19 10:09:41 +0100 |
commit | 076130ba4650a7c719783f6ea30f281d68219ee9 (patch) | |
tree | edab33717cf261d134266c847a2307226c81d78d /apps | |
parent | cf65cba57466acb24dde3215d1a769fd445df600 (diff) | |
parent | 4d0a05f81f6940c12ad60b379c0645e0eadf4031 (diff) | |
download | nextcloud-server-076130ba4650a7c719783f6ea30f281d68219ee9.tar.gz nextcloud-server-076130ba4650a7c719783f6ea30f281d68219ee9.zip |
Merge pull request #24195 from nextcloud/backport/24098/stable19
[stable19] circleId too short in some request
Diffstat (limited to 'apps')
-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 579391efc5c..cdbacafb751 100644 --- a/apps/files_sharing/lib/Controller/ShareAPIController.php +++ b/apps/files_sharing/lib/Controller/ShareAPIController.php @@ -1622,10 +1622,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) { |