summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2020-11-19 10:09:41 +0100
committerGitHub <noreply@github.com>2020-11-19 10:09:41 +0100
commit076130ba4650a7c719783f6ea30f281d68219ee9 (patch)
treeedab33717cf261d134266c847a2307226c81d78d /apps
parentcf65cba57466acb24dde3215d1a769fd445df600 (diff)
parent4d0a05f81f6940c12ad60b379c0645e0eadf4031 (diff)
downloadnextcloud-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.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) {