Skip to content

Commit 6343839

Browse files
fix(files_sharing): skip expiration notify for invalid share record
Signed-off-by: Luka Trovic <luka@nextcloud.com>
1 parent 812f6f0 commit 6343839

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

apps/files_sharing/lib/Command/ExiprationNotification.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
*/
99
namespace OCA\Files_Sharing\Command;
1010

11+
use OCA\Files_Sharing\OrphanHelper;
1112
use OCP\AppFramework\Utility\ITimeFactory;
1213
use OCP\IDBConnection;
1314
use OCP\Notification\IManager as NotificationManager;
@@ -23,6 +24,7 @@ public function __construct(
2324
private NotificationManager $notificationManager,
2425
private IDBConnection $connection,
2526
private ShareManager $shareManager,
27+
private OrphanHelper $orphanHelper,
2628
) {
2729
parent::__construct();
2830
}
@@ -50,7 +52,8 @@ public function execute(InputInterface $input, OutputInterface $output): int {
5052
foreach ($shares as $share) {
5153
if ($share->getExpirationDate() === null
5254
|| $share->getExpirationDate()->getTimestamp() < $minTime->getTimestamp()
53-
|| $share->getExpirationDate()->getTimestamp() > $maxTime->getTimestamp()) {
55+
|| $share->getExpirationDate()->getTimestamp() > $maxTime->getTimestamp()
56+
|| !$this->orphanHelper->isShareValid($share->getSharedBy(), $share->getNodeId())) {
5457
continue;
5558
}
5659

0 commit comments

Comments
 (0)