mirror of
https://github.com/nextcloud/server.git
synced 2026-04-21 14:23:17 -04:00
fix(files_sharing): skip expiration notify for invalid share record
Signed-off-by: Luka Trovic <luka@nextcloud.com>
This commit is contained in:
parent
f80fdbfd92
commit
d7f885b1cb
1 changed files with 4 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue