diff options
author | Luka Trovic <luka@nextcloud.com> | 2025-01-29 15:44:53 +0100 |
---|---|---|
committer | backportbot[bot] <backportbot[bot]@users.noreply.github.com> | 2025-03-20 19:00:47 +0000 |
commit | 2fec667fe443d0954c6055c8569a2ff3d537c1b3 (patch) | |
tree | 66afb8aff09e9cc1f8eb922c0059067913e59b10 | |
parent | 4d061566bdeef5072fd179d1d41d9dca2816c3f3 (diff) | |
download | nextcloud-server-backport/50542/stable31.tar.gz nextcloud-server-backport/50542/stable31.zip |
fix(files_sharing): skip expiration notify for invalid share recordbackport/50542/stable31
Signed-off-by: Luka Trovic <luka@nextcloud.com>
-rw-r--r-- | apps/files_sharing/lib/Command/ExiprationNotification.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/apps/files_sharing/lib/Command/ExiprationNotification.php b/apps/files_sharing/lib/Command/ExiprationNotification.php index df5656a434e..b7ea5c5f14e 100644 --- a/apps/files_sharing/lib/Command/ExiprationNotification.php +++ b/apps/files_sharing/lib/Command/ExiprationNotification.php @@ -8,6 +8,7 @@ declare(strict_types=1); */ 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 @@ class ExiprationNotification extends Command { private NotificationManager $notificationManager, private IDBConnection $connection, private ShareManager $shareManager, + private OrphanHelper $orphanHelper, ) { parent::__construct(); } @@ -50,7 +52,8 @@ class ExiprationNotification extends Command { 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; } |