fix error when search pattern is empty

This commit is contained in:
2022-04-08 00:11:08 +02:00
parent 7ffb3dc74f
commit 4257a918f3
2 changed files with 5 additions and 2 deletions

View File

@@ -136,8 +136,11 @@ final class PersonACLAwareRepository implements PersonACLAwareRepositoryInterfac
$andWhereSearchClause = [];
$andWhereSearchClauseArgs = [];
if ('' !== $default) {
if ('' !== trim($default)) {
foreach (explode(' ', $default) as $str) {
if ('' === trim($str)) {
continue;
}
$pertinence[] =
'STRICT_WORD_SIMILARITY(LOWER(UNACCENT(?)), person.fullnamecanonical) + ' .
"(person.fullnamecanonical LIKE '%' || LOWER(UNACCENT(?)) || '%')::int + " .