Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions lib/private/Share20/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -1090,7 +1090,7 @@ public function getShareByToken($token) {
}

if ($share === null) {
throw new ShareNotFound();
throw new ShareNotFound($this->l->t('The requested share does not exist anymore'));
}

$this->checkExpireDate($share);
Expand All @@ -1110,7 +1110,7 @@ protected function checkExpireDate($share) {
if ($share->getExpirationDate() !== null &&
$share->getExpirationDate() <= new \DateTime()) {
$this->deleteShare($share);
throw new ShareNotFound();
throw new ShareNotFound($this->l->t('The requested share does not exist anymore'));
}

}
Expand Down
5 changes: 5 additions & 0 deletions tests/lib/Share20/ManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2142,6 +2142,7 @@ public function testGetShareByTokenWithException() {

/**
* @expectedException \OCP\Share\Exceptions\ShareNotFound
* @expectedExceptionMessage The requested share does not exist anymore
*/
public function testGetShareByTokenExpired() {
$this->config
Expand All @@ -2150,6 +2151,10 @@ public function testGetShareByTokenExpired() {
->with('core', 'shareapi_allow_links', 'yes')
->willReturn('yes');

$this->l->expects($this->once())
->method('t')
->willReturnArgument(0);

$manager = $this->createManagerMock()
->setMethods(['deleteShare'])
->getMock();
Expand Down