Skip to content
Closed
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
6 changes: 4 additions & 2 deletions lib/private/Share20/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -1270,7 +1270,6 @@ public function getSharesBy($userId, $shareType, $path = null, $reshares = false
continue;
}

$added++;
$shares2[] = $share;

if (count($shares2) === $limit) {
Expand Down Expand Up @@ -1469,11 +1468,14 @@ public function getShareByToken($token) {
/**
* Check expire date and disabled owner
*
* @param int &$added If given, will be decremented if the share is deleted
* @throws ShareNotFound
*/
protected function checkShare(IShare $share): void {
private function checkShare(IShare $share, int &$added = 1): void {
if ($share->isExpired()) {
$this->deleteShare($share);
// Remove 1 to added, because this share was deleted
$added--;
throw new ShareNotFound($this->l->t('The requested share does not exist anymore'));
}
if ($this->config->getAppValue('files_sharing', 'hide_disabled_user_shares', 'no') === 'yes') {
Expand Down