mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-03-01 04:49:36 +00:00
Update PartSearchFilter.php
This commit is contained in:
parent
e5b3507bcc
commit
a131d1cd3b
1 changed files with 2 additions and 2 deletions
|
|
@ -145,7 +145,7 @@ class PartSearchFilter implements FilterInterface
|
||||||
//Use equal expression to just search for exact numeric matches
|
//Use equal expression to just search for exact numeric matches
|
||||||
if ($search_dbId) {
|
if ($search_dbId) {
|
||||||
$expressions[] = $queryBuilder->expr()->eq('part.id', ':id_exact');
|
$expressions[] = $queryBuilder->expr()->eq('part.id', ':id_exact');
|
||||||
params[] = new \Doctrine\ORM\Query\Parameter('id_exact', (int) $this->keyword,
|
$params[] = new \Doctrine\ORM\Query\Parameter('id_exact', (int) $this->keyword,
|
||||||
ParameterType::INTEGER);
|
ParameterType::INTEGER);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -156,7 +156,7 @@ class PartSearchFilter implements FilterInterface
|
||||||
}, $fields_to_search);
|
}, $fields_to_search);
|
||||||
|
|
||||||
//For regex, we pass the query as is, save html special chars
|
//For regex, we pass the query as is, save html special chars
|
||||||
params[] = new \Doctrine\ORM\Query\Parameter('search_query', $this->keyword);
|
$params[] = new \Doctrine\ORM\Query\Parameter('search_query', $this->keyword);
|
||||||
} else {
|
} else {
|
||||||
//Escape % and _ characters in the keyword
|
//Escape % and _ characters in the keyword
|
||||||
$this->keyword = str_replace(['%', '_'], ['\%', '\_'], $this->keyword);
|
$this->keyword = str_replace(['%', '_'], ['\%', '\_'], $this->keyword);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue