Use DBA::quoteIdentifier in Database::escapeFields
This commit is contained in:
parent
95b67f5e46
commit
e445975c20
2 changed files with 3 additions and 3 deletions
|
@ -531,9 +531,9 @@ class DBA
|
|||
}
|
||||
|
||||
/**
|
||||
* Escape an identifier (table or field name) optional with a schema like (schema.)table
|
||||
* Escape an identifier (table or field name) optional with a schema like ((schema.)table.)field
|
||||
*
|
||||
* @param $identifier Table, field name
|
||||
* @param string $identifier Table, field name
|
||||
* @return string Quotes table or field name
|
||||
*/
|
||||
public static function quoteIdentifier(string $identifier): string
|
||||
|
|
|
@ -1438,7 +1438,7 @@ class Database
|
|||
array_walk($fields, function(&$value, $key) use ($options)
|
||||
{
|
||||
$field = $value;
|
||||
$value = '`' . str_replace('`', '``', $value) . '`';
|
||||
$value = DBA::quoteIdentifier($field);
|
||||
|
||||
if (!empty($options['group_by']) && !in_array($field, $options['group_by'])) {
|
||||
$value = 'ANY_VALUE(' . $value . ') AS ' . $value;
|
||||
|
|
Loading…
Reference in a new issue