From d2b7d1711bde3044c39580bfa4333f3bf1771094 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Mon, 20 Aug 2018 10:48:36 +0200 Subject: [PATCH] Use createPositionalParameter() - see https://github.com/owncloud/documentation/issues/3805#issuecomment-414241115 --- apps/files_sharing/lib/Command/CleanupRemoteStorages.php | 4 ++-- lib/private/Files/Type/Loader.php | 8 ++++---- lib/private/SystemTag/SystemTagManager.php | 4 ++-- lib/private/User/AccountMapper.php | 8 ++++---- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/apps/files_sharing/lib/Command/CleanupRemoteStorages.php b/apps/files_sharing/lib/Command/CleanupRemoteStorages.php index f5c509c6e54a..0e3536916e43 100644 --- a/apps/files_sharing/lib/Command/CleanupRemoteStorages.php +++ b/apps/files_sharing/lib/Command/CleanupRemoteStorages.php @@ -138,13 +138,13 @@ public function getRemoteStorages() { ->where($queryBuilder->expr()->like( 'id', // match all 'shared::' + 32 characters storages - $queryBuilder->createNamedParameter('shared::________________________________', IQueryBuilder::PARAM_STR), + $queryBuilder->createPositionalParameter('shared::________________________________', IQueryBuilder::PARAM_STR), 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->createPositionalParameter('shared::/%', IQueryBuilder::PARAM_STR), IQueryBuilder::PARAM_STR) )->orderBy('numeric_id'); $query = $queryBuilder->execute(); diff --git a/lib/private/Files/Type/Loader.php b/lib/private/Files/Type/Loader.php index 1ba8f162db54..f5b82f0a4caf 100644 --- a/lib/private/Files/Type/Loader.php +++ b/lib/private/Files/Type/Loader.php @@ -161,15 +161,15 @@ public function updateFilecache($ext, $mimetypeId) { $is_folderId = $this->getId('httpd/unix-directory'); $update = $this->dbConnection->getQueryBuilder(); $update->update('filecache') - ->set('mimetype', $update->createNamedParameter($mimetypeId)) + ->set('mimetype', $update->createPositionalParameter($mimetypeId)) ->where($update->expr()->neq( - 'mimetype', $update->createNamedParameter($mimetypeId) + 'mimetype', $update->createPositionalParameter($mimetypeId) )) ->andwhere($update->expr()->neq( - 'mimetype', $update->createNamedParameter($is_folderId) + 'mimetype', $update->createPositionalParameter($is_folderId) )) ->andWhere($update->expr()->like( - $update->createFunction('LOWER(`name`)'), $update->createNamedParameter($ext) + $update->createFunction('LOWER(`name`)'), $update->createPositionalParameter($ext) )); return $update->execute(); } diff --git a/lib/private/SystemTag/SystemTagManager.php b/lib/private/SystemTag/SystemTagManager.php index b989b5d1338e..d2887e3ba899 100644 --- a/lib/private/SystemTag/SystemTagManager.php +++ b/lib/private/SystemTag/SystemTagManager.php @@ -133,14 +133,14 @@ public function getAllTags($visibilityFilter = null, $nameSearchPattern = null) ->from(self::TAG_TABLE); if ($visibilityFilter !== null) { - $query->andWhere($query->expr()->eq('visibility', $query->createNamedParameter((int)$visibilityFilter))); + $query->andWhere($query->expr()->eq('visibility', $query->createPositionalParameter((int)$visibilityFilter))); } if (!empty($nameSearchPattern)) { $query->andWhere( $query->expr()->like( 'name', - $query->createNamedParameter('%' . $this->connection->escapeLikeParameter($nameSearchPattern). '%') + $query->createPositionalParameter('%' . $this->connection->escapeLikeParameter($nameSearchPattern). '%') ) ); } diff --git a/lib/private/User/AccountMapper.php b/lib/private/User/AccountMapper.php index 9deeda54a434..3d371c243c87 100644 --- a/lib/private/User/AccountMapper.php +++ b/lib/private/User/AccountMapper.php @@ -172,10 +172,10 @@ public function find($pattern, $limit = null, $offset = null) { ->from($this->getTableName(), 'a') ->leftJoin('a', 'account_terms', 't', $qb->expr()->eq('a.id', 't.account_id')) ->orderBy('display_name') - ->where($qb->expr()->like('lower_user_id', $qb->createNamedParameter($loweredParameter))) - ->orWhere($qb->expr()->iLike('display_name', $qb->createNamedParameter($parameter))) - ->orWhere($qb->expr()->iLike('email', $qb->createNamedParameter($parameter))) - ->orWhere($qb->expr()->like('t.term', $qb->createNamedParameter($loweredParameter))); + ->where($qb->expr()->like('lower_user_id', $qb->createPositionalParameter($loweredParameter))) + ->orWhere($qb->expr()->iLike('display_name', $qb->createPositionalParameter($parameter))) + ->orWhere($qb->expr()->iLike('email', $qb->createPositionalParameter($parameter))) + ->orWhere($qb->expr()->like('t.term', $qb->createPositionalParameter($loweredParameter))); return $this->findEntities($qb->getSQL(), $qb->getParameters(), $limit, $offset); }