summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2018-10-16 14:55:41 +0200
committerMorris Jobke <hey@morrisjobke.de>2018-10-16 15:24:02 +0200
commitb458ed9c82eeca4eafb4e86b7774ceba90130838 (patch)
tree2f7187dd4de5c1ee7a83247759c6d3b975872aa7 /apps
parentad66b0f9ab010ee00d249d6f8512d30332e8a0af (diff)
downloadnextcloud-server-b458ed9c82eeca4eafb4e86b7774ceba90130838.tar.gz
nextcloud-server-b458ed9c82eeca4eafb4e86b7774ceba90130838.zip
Properly escape column name in "createFunction" call
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'apps')
-rw-r--r--apps/dav/lib/Migration/BuildCalendarSearchIndex.php2
-rw-r--r--apps/files_sharing/lib/Command/CleanupRemoteStorages.php2
-rw-r--r--apps/user_ldap/lib/Mapping/AbstractMapping.php2
3 files changed, 3 insertions, 3 deletions
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();