Browse Source

fix(logging): Fix query logging with DateTimeImmutable parameters

Signed-off-by: Joas Schilling <coding@schilljs.com>
pull/54230/head
Joas Schilling 4 months ago
parent
commit
c722f8c88b
No known key found for this signature in database GPG Key ID: F72FA5B49FFA96B0
  1. 2
      lib/private/DB/QueryBuilder/QueryBuilder.php

2
lib/private/DB/QueryBuilder/QueryBuilder.php

@ -161,7 +161,7 @@ class QueryBuilder implements IQueryBuilder {
try {
$params = [];
foreach ($this->getParameters() as $placeholder => $value) {
if ($value instanceof \DateTime) {
if ($value instanceof \DateTimeInterface) {
$params[] = $placeholder . ' => DateTime:\'' . $value->format('c') . '\'';
} elseif (is_array($value)) {
$params[] = $placeholder . ' => (\'' . implode('\', \'', $value) . '\')';

Loading…
Cancel
Save