aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/lib/ExpireSharesJob.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_sharing/lib/ExpireSharesJob.php')
-rw-r--r--apps/files_sharing/lib/ExpireSharesJob.php12
1 files changed, 4 insertions, 8 deletions
diff --git a/apps/files_sharing/lib/ExpireSharesJob.php b/apps/files_sharing/lib/ExpireSharesJob.php
index 8ea6fee8a5c..b1c6c592e80 100644
--- a/apps/files_sharing/lib/ExpireSharesJob.php
+++ b/apps/files_sharing/lib/ExpireSharesJob.php
@@ -1,4 +1,5 @@
<?php
+
/**
* SPDX-FileCopyrightText: 2017-2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
@@ -8,6 +9,7 @@ namespace OCA\Files_Sharing;
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\BackgroundJob\TimedJob;
+use OCP\DB\QueryBuilder\IQueryBuilder;
use OCP\IDBConnection;
use OCP\Share\Exceptions\ShareNotFound;
use OCP\Share\IManager;
@@ -49,15 +51,9 @@ class ExpireSharesJob extends TimedJob {
->from('share')
->where(
$qb->expr()->andX(
- $qb->expr()->orX(
- $qb->expr()->eq('share_type', $qb->expr()->literal(IShare::TYPE_LINK)),
- $qb->expr()->eq('share_type', $qb->expr()->literal(IShare::TYPE_EMAIL))
- ),
+ $qb->expr()->in('share_type', $qb->createNamedParameter([IShare::TYPE_LINK, IShare::TYPE_EMAIL], IQueryBuilder::PARAM_INT_ARRAY)),
$qb->expr()->lte('expiration', $qb->expr()->literal($now)),
- $qb->expr()->orX(
- $qb->expr()->eq('item_type', $qb->expr()->literal('file')),
- $qb->expr()->eq('item_type', $qb->expr()->literal('folder'))
- )
+ $qb->expr()->in('item_type', $qb->createNamedParameter(['file', 'folder'], IQueryBuilder::PARAM_STR_ARRAY))
)
);