Skip to content

Commit 99e8ec8

Browse files
committed
fix(objectstore): add named parameter for like query
to avoid 'object::%' to be considered as a column (`la colonne \\u00ab object::% \\u00bb n'existe pas` on PG) Signed-off-by: Thomas Citharel <[email protected]>
1 parent 76a0fb6 commit 99e8ec8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/private/Files/ObjectStore/ObjectStoreStorage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -831,7 +831,7 @@ public function free_space(string $path): int|float|false {
831831
$result = $qb->select($qb->func()->sum('f.size'))
832832
->from('storages', 's')
833833
->leftJoin('s', 'filecache', 'f', $qb->expr()->eq('f.storage', 's.numeric_id'))
834-
->where($qb->expr()->like('s.id', 'object::%', IQueryBuilder::PARAM_STR))
834+
->where($qb->expr()->like('s.id', $qb->createNamedParameter('object::%'), IQueryBuilder::PARAM_STR))
835835
->andWhere($qb->expr()->eq('f.path', $qb->createNamedParameter('')))
836836
->executeQuery();
837837
$used = $result->fetchOne();

0 commit comments

Comments
 (0)