Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/survey_client.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2018-10-16 15:57:57 +0300
committerMorris Jobke <hey@morrisjobke.de>2018-10-16 15:57:57 +0300
commit67beeaa61cd42c521c3e8f1e9d0db9ff3519efb8 (patch)
treed2dd727433d60c87972da6f059eaf9bd7d2dc8ca /lib
parent0e06ebd8ae91492690c599f3e833d1ea4832a12e (diff)
Properly escape column name in "createFunction" call
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/Categories/Stats.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Categories/Stats.php b/lib/Categories/Stats.php
index 41e49bd..dd0fc1b 100644
--- a/lib/Categories/Stats.php
+++ b/lib/Categories/Stats.php
@@ -125,11 +125,11 @@ class Stats implements ICategory {
* @return int
*/
protected function countEntries($tableName, $column = '*') {
+ $query = $this->connection->getQueryBuilder();
+
if ($column !== '*') {
- $column = 'DISTINCT(' . $column . ')';
+ $column = 'DISTINCT(' . $query->getColumnName($column ) . ')';
}
-
- $query = $this->connection->getQueryBuilder();
$query->selectAlias($query->createFunction('COUNT(' . $column . ')'), 'num_entries')
->from($tableName);
$result = $query->execute();