Skip to content

Commit

Permalink
User is not found when is searched by name and one of surnames #7510
Browse files Browse the repository at this point in the history
  • Loading branch information
Flávio Gomes da Silva Lisboa committed Sep 14, 2018
1 parent 6112adf commit 174f19f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions apps/user_ldap/lib/Access.php
Original file line number Diff line number Diff line change
Expand Up @@ -1451,6 +1451,11 @@ private function getAdvancedFilterPartForSearch($search, $searchAttributes) {
throw new \Exception('searchAttributes must be an array with at least two string');
}
$searchWords = explode(' ', trim($search));
// insert * among words
$trimmedArray = array_map('trim', $searchWords);
$onlyValuesArray = array_filter($trimmedArray);
$searchWords = array();
$searchWords[] = implode('*', $onlyValuesArray);
$wordFilters = array();
foreach($searchWords as $word) {
$word = $this->prepareSearchTerm($word);
Expand Down

0 comments on commit 174f19f

Please sign in to comment.