From 5ed56d9edb54bf3f977ea12f44fca9e4b650c72b Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Fri, 5 Feb 2016 12:59:46 +0100 Subject: 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 --- lib/private/share20/manager.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib') 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; } -- cgit v1.2.3