Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion lib/Db/FsManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
use OCP\IRequest;
use OCP\IUserManager;
use OCP\IUserSession;
use OCP\Share\Exceptions\ShareNotFound;
use OCP\Share\IShare;

final class FsManager
Expand Down Expand Up @@ -317,7 +318,17 @@ public function getShareObject(): ?IShare
}

// Get share by token
$share = \OC::$server->get(\OCP\Share\IManager::class)->getShareByToken($token);
$share = null;

// This might be invoked for public albums, in this case the token parameter
// contains the collaborator_id of the album rather than a proper share token.
//
// Catch the ShareNotFound exception to enable further processing of the request.
try {
$share = \OC::$server->get(\OCP\Share\IManager::class)->getShareByToken($token);
} catch (ShareNotFound $e) {
return null;
}
if (!self::validateShare($share)) {
return null;
}
Expand Down