diff --git a/lib/ShareByCircleProvider.php b/lib/ShareByCircleProvider.php index 32a8e5399..78a8a3372 100644 --- a/lib/ShareByCircleProvider.php +++ b/lib/ShareByCircleProvider.php @@ -569,30 +569,18 @@ function (ShareWrapper $wrapper) { } /** + * Team shares are reached through the membership-based mount, never via the + * public /s/ route. Refusing to resolve the token here keeps the + * share out of the public share controller even though a token is still + * stored on the share row (it is reused as a mount-row key elsewhere). + * * @param string $token * * @return IShare - * @throws IllegalIDChangeException - * @throws RequestBuilderException * @throws ShareNotFound */ public function getShareByToken($token): IShare { - if (is_null($token)) { - throw new ShareNotFound(); - } - - try { - $wrappedShare = $this->shareWrapperService->getShareByToken($token); - } catch (ShareWrapperNotFoundException $e) { - throw new ShareNotFound(); - } - - $share = $wrappedShare->getShare($this->rootFolder, $this->userManager, $this->urlGenerator); - if ($share->getPassword() !== '') { - $this->logger->notice('share is protected by a password, hash: ' . $share->getPassword()); - } - - return $share; + throw new ShareNotFound(); }