tq: fix debug quoting

Signed-off-by: Varun Patil <radialapps@gmail.com>
pull/877/head
Varun Patil 2023-10-13 16:59:14 -07:00
parent 0c2de94ee3
commit 5ce8696efb
1 changed files with 4 additions and 4 deletions

View File

@ -61,16 +61,16 @@ class TimelineQuery
public static function replaceQueryParams(IQueryBuilder &$query, string $sql) public static function replaceQueryParams(IQueryBuilder &$query, string $sql)
{ {
$params = $query->getParameters(); $params = $query->getParameters();
$platform = $query->getConnection()->getDatabasePlatform();
foreach ($params as $key => $value) { foreach ($params as $key => $value) {
if (\is_array($value)) { if (\is_array($value)) {
$value = implode(',', $value); $value = implode(',', array_map(static fn ($v) => $platform->quoteStringLiteral($v), $value));
} elseif (\is_bool($value)) { } elseif (\is_bool($value)) {
$value = $value ? '1' : '0'; $value = $platform->quoteStringLiteral($value ? '1' : '0');
} elseif (null === $value) { } elseif (null === $value) {
$value = 'NULL'; $value = $platform->quoteStringLiteral('NULL');
} }
$value = $query->getConnection()->getDatabasePlatform()->quoteStringLiteral($value);
$sql = str_replace(':'.$key, $value, $sql); $sql = str_replace(':'.$key, $value, $sql);
} }