From 5ce8696efb74e281fdb6d1dde146e412c50ed7f1 Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Fri, 13 Oct 2023 16:59:14 -0700 Subject: [PATCH] tq: fix debug quoting Signed-off-by: Varun Patil --- lib/Db/TimelineQuery.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/Db/TimelineQuery.php b/lib/Db/TimelineQuery.php index 6965785d..06242fc9 100644 --- a/lib/Db/TimelineQuery.php +++ b/lib/Db/TimelineQuery.php @@ -61,16 +61,16 @@ class TimelineQuery public static function replaceQueryParams(IQueryBuilder &$query, string $sql) { $params = $query->getParameters(); + $platform = $query->getConnection()->getDatabasePlatform(); foreach ($params as $key => $value) { if (\is_array($value)) { - $value = implode(',', $value); + $value = implode(',', array_map(static fn ($v) => $platform->quoteStringLiteral($v), $value)); } elseif (\is_bool($value)) { - $value = $value ? '1' : '0'; + $value = $platform->quoteStringLiteral($value ? '1' : '0'); } elseif (null === $value) { - $value = 'NULL'; + $value = $platform->quoteStringLiteral('NULL'); } - $value = $query->getConnection()->getDatabasePlatform()->quoteStringLiteral($value); $sql = str_replace(':'.$key, $value, $sql); }