diff options
author | Bjoern Schiessle <bjoern@schiessle.org> | 2016-06-30 17:32:37 +0300 |
---|---|---|
committer | Bjoern Schiessle <bjoern@schiessle.org> | 2016-06-30 17:45:13 +0300 |
commit | 347787d92c9f5f0e50bb87aa78d3fe692c88003f (patch) | |
tree | cf61a552e62b689dd8838961639c968a5c9f7996 /lib | |
parent | 29929c97285adca090ee927cb3fd5ef8b52e451b (diff) |
getShareByToken() should also consider remote shares
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/share20/manager.php | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/private/share20/manager.php b/lib/private/share20/manager.php index 5d53d0ef839..e7dafb2a0c3 100644 --- a/lib/private/share20/manager.php +++ b/lib/private/share20/manager.php @@ -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()) { |