diff options
author | Morris Jobke <hey@morrisjobke.de> | 2018-10-16 15:57:57 +0300 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2018-10-16 15:57:57 +0300 |
commit | 67beeaa61cd42c521c3e8f1e9d0db9ff3519efb8 (patch) | |
tree | d2dd727433d60c87972da6f059eaf9bd7d2dc8ca /lib | |
parent | 0e06ebd8ae91492690c599f3e833d1ea4832a12e (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.php | 6 |
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(); |