mirror of
https://github.com/nextcloud/server.git
synced 2026-06-11 09:42:09 -04:00
Merge pull request #266 from nextcloud/fix-262
[stable9] getShareByToken() should also consider remote shares
This commit is contained in:
commit
eed6c6a8b9
1 changed files with 11 additions and 1 deletions
|
|
@ -986,7 +986,17 @@ class Manager implements IManager {
|
|||
public function getShareByToken($token) {
|
||||
$provider = $this->factory->getProviderForType(\OCP\Share::SHARE_TYPE_LINK);
|
||||
|
||||
$share = $provider->getShareByToken($token);
|
||||
try {
|
||||
$share = $provider->getShareByToken($token);
|
||||
} catch (ShareNotFound $e) {
|
||||
//Ignore
|
||||
}
|
||||
|
||||
// If it is not a link share try to fetch a federated share by token
|
||||
if ($share === null) {
|
||||
$provider = $this->factory->getProviderForType(\OCP\Share::SHARE_TYPE_REMOTE);
|
||||
$share = $provider->getShareByToken($token);
|
||||
}
|
||||
|
||||
if ($share->getExpirationDate() !== null &&
|
||||
$share->getExpirationDate() <= new \DateTime()) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue