Browse Source

Escape the search terms on the server

Signed-off-by: Joas Schilling <coding@schilljs.com>
tags/v16.0.0beta3
Joas Schilling 5 years ago
parent
commit
cfa6c7cb71
No account linked to committer's email address
1 changed files with 6 additions and 2 deletions
  1. 6
    2
      lib/private/Collaboration/Resources/Manager.php

+ 6
- 2
lib/private/Collaboration/Resources/Manager.php View File

@@ -138,11 +138,15 @@ class Manager implements IManager {
$query->expr()->eq('a.user_id', $query->createNamedParameter($userId, IQueryBuilder::PARAM_STR))
)
)
->where($query->expr()->iLike('c.name', $query->createNamedParameter($filter, IQueryBuilder::PARAM_STR)))
->andWhere($query->expr()->eq('a.access', $query->createNamedParameter(1, IQueryBuilder::PARAM_INT)))
->where($query->expr()->eq('a.access', $query->createNamedParameter(1, IQueryBuilder::PARAM_INT)))
->orderBy('c.id')
->setMaxResults($limit)
->setFirstResult($start);

if ($filter !== '') {
$query->where($query->expr()->iLike('c.name', $query->createNamedParameter('%' . $this->connection->escapeLikeParameter($filter) . '%')));
}

$result = $query->execute();
$collections = [];


Loading…
Cancel
Save