mirror of
https://github.com/nextcloud/server.git
synced 2026-06-11 09:42:09 -04:00
Merge pull request #31614 from nextcloud/bugfix/noid/simplify-comment-search-in-special-cases
Simplify comment search in special cases
This commit is contained in:
commit
642f07ca3c
1 changed files with 6 additions and 3 deletions
|
|
@ -611,13 +611,16 @@ class Manager implements ICommentsManager {
|
|||
|
||||
$query->select('*')
|
||||
->from('comments')
|
||||
->where($query->expr()->iLike('message', $query->createNamedParameter(
|
||||
'%' . $this->dbConn->escapeLikeParameter($search). '%'
|
||||
)))
|
||||
->orderBy('creation_timestamp', 'DESC')
|
||||
->addOrderBy('id', 'DESC')
|
||||
->setMaxResults($limit);
|
||||
|
||||
if ($search !== '') {
|
||||
$query->where($query->expr()->iLike('message', $query->createNamedParameter(
|
||||
'%' . $this->dbConn->escapeLikeParameter($search). '%'
|
||||
)));
|
||||
}
|
||||
|
||||
if ($objectType !== '') {
|
||||
$query->andWhere($query->expr()->eq('object_type', $query->createNamedParameter($objectType)));
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue