aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Wurst <ChristophWurst@users.noreply.github.com>2020-11-17 13:32:20 +0100
committerGitHub <noreply@github.com>2020-11-17 13:32:20 +0100
commit8a710c88372511dcb68abab195771d2a9639061e (patch)
treef2638399bcda42a9a2892720fda2e799504bae0d
parentec4a2263428b6606c83357b70520a79f5f48e7e2 (diff)
parentabb05a5b1f3c1db613ff64ee3ba294ac0fc81637 (diff)
downloadnextcloud-server-8a710c88372511dcb68abab195771d2a9639061e.tar.gz
nextcloud-server-8a710c88372511dcb68abab195771d2a9639061e.zip
Merge pull request #24177 from nextcloud/backport/24098/stable19
[stable19] circleId too short in some request
-rw-r--r--apps/files_sharing/lib/Controller/ShareAPIController.php7
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) {