]> source.dussan.org Git - nextcloud-server.git/commitdiff
Revert "[stable20] circleId too short in some request" 24183/head
authorChristoph Wurst <ChristophWurst@users.noreply.github.com>
Tue, 17 Nov 2020 13:20:02 +0000 (14:20 +0100)
committerGitHub <noreply@github.com>
Tue, 17 Nov 2020 13:20:02 +0000 (14:20 +0100)
apps/files_sharing/lib/Controller/ShareAPIController.php

index aaca16b32e6cedcd40ed4e3df04615e308f54a2c..2c2ec393d3f2b53b4d57408decb5bec20e1bb3f2 100644 (file)
@@ -1648,11 +1648,10 @@ class ShareAPIController extends OCSController {
                        $hasCircleId = (substr($share->getSharedWith(), -1) === ']');
                        $shareWithStart = ($hasCircleId ? strrpos($share->getSharedWith(), '[') + 1 : 0);
                        $shareWithLength = ($hasCircleId ? -1 : strpos($share->getSharedWith(), ' '));
-                       if ($shareWithLength === false) {
-                               $sharedWith = substr($share->getSharedWith(), $shareWithStart);
-                       } else {
-                               $sharedWith = substr($share->getSharedWith(), $shareWithStart, $shareWithLength);
+                       if (is_bool($shareWithLength)) {
+                               $shareWithLength = -1;
                        }
+                       $sharedWith = substr($share->getSharedWith(), $shareWithStart, $shareWithLength);
                        try {
                                $member = \OCA\Circles\Api\v1\Circles::getMember($sharedWith, $userId, 1);
                                if ($member->getLevel() >= 4) {