From 833ec55728b04763f32950998736eaa053accd31 Mon Sep 17 00:00:00 2001 From: Luka Trovic Date: Wed, 29 Jan 2025 15:44:53 +0100 Subject: [PATCH] fix(files_sharing): skip expiration notify for invalid share record Signed-off-by: Luka Trovic --- apps/files_sharing/lib/Command/ExiprationNotification.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/files_sharing/lib/Command/ExiprationNotification.php b/apps/files_sharing/lib/Command/ExiprationNotification.php index df5656a434e63..b7ea5c5f14e92 100644 --- a/apps/files_sharing/lib/Command/ExiprationNotification.php +++ b/apps/files_sharing/lib/Command/ExiprationNotification.php @@ -8,6 +8,7 @@ */ namespace OCA\Files_Sharing\Command; +use OCA\Files_Sharing\OrphanHelper; use OCP\AppFramework\Utility\ITimeFactory; use OCP\IDBConnection; use OCP\Notification\IManager as NotificationManager; @@ -23,6 +24,7 @@ public function __construct( private NotificationManager $notificationManager, private IDBConnection $connection, private ShareManager $shareManager, + private OrphanHelper $orphanHelper, ) { parent::__construct(); } @@ -50,7 +52,8 @@ public function execute(InputInterface $input, OutputInterface $output): int { foreach ($shares as $share) { if ($share->getExpirationDate() === null || $share->getExpirationDate()->getTimestamp() < $minTime->getTimestamp() - || $share->getExpirationDate()->getTimestamp() > $maxTime->getTimestamp()) { + || $share->getExpirationDate()->getTimestamp() > $maxTime->getTimestamp() + || !$this->orphanHelper->isShareValid($share->getSharedBy(), $share->getNodeId())) { continue; }