diff options
author | Maxence Lange <maxence@artificial-owl.com> | 2020-11-16 13:25:59 +0300 |
---|---|---|
committer | Maxence Lange <maxence@artificial-owl.com> | 2020-11-16 13:25:59 +0300 |
commit | 7deddf3ba995dde31622a41908fbc8ea6bd15a5a (patch) | |
tree | 863b753376e4ab3ea6e3787f2dba9d4c968845b2 | |
parent | d242e497f4c36a40e12f460a8720280bf80563be (diff) |
circleId too short in some request
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
-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 39cfe7c6659..de07a511d18 100644 --- a/apps/files_sharing/lib/Controller/ShareAPIController.php +++ b/apps/files_sharing/lib/Controller/ShareAPIController.php @@ -1609,10 +1609,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) { |