diff options
author | Kate <26026535+provokateurin@users.noreply.github.com> | 2025-03-17 15:04:06 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-17 15:04:06 +0100 |
commit | 5170c73390c91f214ccd92f3e8a2688c2b3599ee (patch) | |
tree | 374585eb79381e5467784d219c7ebd2de1f5f0ec | |
parent | f80fdbfd9224a9566abf637aa910063094a88f2c (diff) | |
parent | d7f885b1cb2244f74509786152b1eba1d2eb8f8a (diff) | |
download | nextcloud-server-5170c73390c91f214ccd92f3e8a2688c2b3599ee.tar.gz nextcloud-server-5170c73390c91f214ccd92f3e8a2688c2b3599ee.zip |
Merge pull request #50542 from nextcloud/fix-sharing-expiration-notify
fix(files_sharing): skip expiration notify for invalid share record
-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; } |