Skip to content
Merged
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
fix(files_sharing): skip expiration notify for invalid share record
Signed-off-by: Luka Trovic <[email protected]>
  • Loading branch information
luka-nextcloud committed Mar 21, 2025
commit 833ec55728b04763f32950998736eaa053accd31
5 changes: 4 additions & 1 deletion apps/files_sharing/lib/Command/ExiprationNotification.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -23,6 +24,7 @@ public function __construct(
private NotificationManager $notificationManager,
private IDBConnection $connection,
private ShareManager $shareManager,
private OrphanHelper $orphanHelper,
) {
parent::__construct();
}
Expand Down Expand Up @@ -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;
}

Expand Down
Loading