From b458ed9c82eeca4eafb4e86b7774ceba90130838 Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Tue, 16 Oct 2018 14:55:41 +0200 Subject: Properly escape column name in "createFunction" call Signed-off-by: Morris Jobke --- apps/dav/lib/Migration/BuildCalendarSearchIndex.php | 2 +- apps/files_sharing/lib/Command/CleanupRemoteStorages.php | 2 +- apps/user_ldap/lib/Mapping/AbstractMapping.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'apps') diff --git a/apps/dav/lib/Migration/BuildCalendarSearchIndex.php b/apps/dav/lib/Migration/BuildCalendarSearchIndex.php index da4b4f4fe84..22274e36c6b 100644 --- a/apps/dav/lib/Migration/BuildCalendarSearchIndex.php +++ b/apps/dav/lib/Migration/BuildCalendarSearchIndex.php @@ -70,7 +70,7 @@ class BuildCalendarSearchIndex implements IRepairStep { } $query = $this->db->getQueryBuilder(); - $query->select($query->createFunction('MAX(id)')) + $query->select($query->createFunction('MAX(' . $query->getColumnName('id') . ')')) ->from('calendarobjects'); $maxId = (int)$query->execute()->fetchColumn(); diff --git a/apps/files_sharing/lib/Command/CleanupRemoteStorages.php b/apps/files_sharing/lib/Command/CleanupRemoteStorages.php index f269b86ea9f..2175982dfc1 100644 --- a/apps/files_sharing/lib/Command/CleanupRemoteStorages.php +++ b/apps/files_sharing/lib/Command/CleanupRemoteStorages.php @@ -98,7 +98,7 @@ class CleanupRemoteStorages extends Command { public function countFiles($numericId, OutputInterface $output) { $queryBuilder = $this->connection->getQueryBuilder(); - $queryBuilder->select($queryBuilder->createFunction('count(fileid)')) + $queryBuilder->select($queryBuilder->createFunction('COUNT(' . $queryBuilder->getColumnName('fileid') . ')')) ->from('filecache') ->where($queryBuilder->expr()->eq( 'storage', diff --git a/apps/user_ldap/lib/Mapping/AbstractMapping.php b/apps/user_ldap/lib/Mapping/AbstractMapping.php index c7d737a7631..c3f09fd6caa 100644 --- a/apps/user_ldap/lib/Mapping/AbstractMapping.php +++ b/apps/user_ldap/lib/Mapping/AbstractMapping.php @@ -311,7 +311,7 @@ abstract class AbstractMapping { */ public function count() { $qb = $this->dbc->getQueryBuilder(); - $query = $qb->select($qb->createFunction('COUNT(`ldap_dn`)')) + $query = $qb->select($qb->createFunction('COUNT(' . $qb->getColumnName('ldap_dn') . ')')) ->from($this->getTableName()); $res = $query->execute(); $count = $res->fetchColumn(); -- cgit v1.2.3