From 7f21e8802d41dd57cb12f9f310238e9abff3e0a4 Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Sun, 5 Feb 2023 12:39:46 -0800 Subject: [PATCH] tq: fix debugger for array --- lib/Db/TimelineQuery.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/Db/TimelineQuery.php b/lib/Db/TimelineQuery.php index 8cc923c1..b18869b8 100644 --- a/lib/Db/TimelineQuery.php +++ b/lib/Db/TimelineQuery.php @@ -40,7 +40,16 @@ class TimelineQuery { $params = $query->getParameters(); foreach ($params as $key => $value) { - $sql = str_replace(':'.$key, $query->getConnection()->getDatabasePlatform()->quoteStringLiteral($value), $sql); + if (\is_array($value)) { + $value = implode(',', $value); + } elseif (\is_bool($value)) { + $value = $value ? '1' : '0'; + } elseif (null === $value) { + $value = 'NULL'; + } + + $value = $query->getConnection()->getDatabasePlatform()->quoteStringLiteral($value); + $sql = str_replace(':'.$key, $value, $sql); } return $sql;