diff options
author | Roeland Jago Douma <rullzer@owncloud.com> | 2016-02-05 12:59:46 +0100 |
---|---|---|
committer | Roeland Jago Douma <rullzer@owncloud.com> | 2016-02-06 13:31:54 +0100 |
commit | 5ed56d9edb54bf3f977ea12f44fca9e4b650c72b (patch) | |
tree | d8bfeba468ff57d882933cca2b93fe9e7097be14 /lib | |
parent | 69a4cd2898d8b65257ccd1e526a4c3baad386a31 (diff) | |
download | nextcloud-server-5ed56d9edb54bf3f977ea12f44fca9e4b650c72b.tar.gz nextcloud-server-5ed56d9edb54bf3f977ea12f44fca9e4b650c72b.zip |
Delete a link share if it is expired on access
If we access a link share we should check if it has expired already.
If so we should remove it and throw a ShareNotFound exception
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/share20/manager.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/private/share20/manager.php b/lib/private/share20/manager.php index d65fb927f9b..a393cdeb89c 100644 --- a/lib/private/share20/manager.php +++ b/lib/private/share20/manager.php @@ -831,7 +831,11 @@ class Manager implements IManager { $share = $provider->getShareByToken($token); - //TODO check if share expired + if ($share->getExpirationDate() !== null && + $share->getExpirationDate() <= new \DateTime()) { + $this->deleteShare($share); + throw new ShareNotFound(); + } return $share; } |