summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2017-03-17 09:59:56 +0100
committerJoas Schilling <coding@schilljs.com>2017-03-17 09:59:56 +0100
commit199405ddc030efd661714b31ac758443efa63d48 (patch)
treee6de75639c097a06d1438c762aee1bd05061de49 /apps
parent0a1135a7cc88e039664eece4635c685f482e4da7 (diff)
downloadnextcloud-server-199405ddc030efd661714b31ac758443efa63d48.tar.gz
nextcloud-server-199405ddc030efd661714b31ac758443efa63d48.zip
Safer queries
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps')
-rw-r--r--apps/files_sharing/lib/Command/CleanupRemoteStorages.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/files_sharing/lib/Command/CleanupRemoteStorages.php b/apps/files_sharing/lib/Command/CleanupRemoteStorages.php
index a94832c1bb9..504caba1417 100644
--- a/apps/files_sharing/lib/Command/CleanupRemoteStorages.php
+++ b/apps/files_sharing/lib/Command/CleanupRemoteStorages.php
@@ -142,13 +142,13 @@ class CleanupRemoteStorages extends Command {
->where($queryBuilder->expr()->like(
'id',
// match all 'shared::' + 32 characters storages
- $queryBuilder->createNamedParameter('shared::________________________________', IQueryBuilder::PARAM_STR),
+ $queryBuilder->createNamedParameter($this->connection->escapeLikeParameter('shared::') . str_repeat('_', 32)),
IQueryBuilder::PARAM_STR)
)
->andWhere($queryBuilder->expr()->notLike(
'id',
// but not the ones starting with a '/', they are for normal shares
- $queryBuilder->createNamedParameter('shared::/%', IQueryBuilder::PARAM_STR),
+ $queryBuilder->createNamedParameter($this->connection->escapeLikeParameter('shared::/') . '%'),
IQueryBuilder::PARAM_STR)
)->orderBy('numeric_id');
$query = $queryBuilder->execute();