diff --git a/apps/user_ldap/lib/Access.php b/apps/user_ldap/lib/Access.php index 3f120caefe6f1..40be2b9601a15 100644 --- a/apps/user_ldap/lib/Access.php +++ b/apps/user_ldap/lib/Access.php @@ -1545,12 +1545,16 @@ private function getFilterPartForSearch(string $search, $searchAttributes, strin return ''; } // wildcards don't work with some attributes - $filter[] = $fallbackAttribute . '=' . $originalSearch; + if ($originalSearch !== '') { + $filter[] = $fallbackAttribute . '=' . $originalSearch; + } $filter[] = $fallbackAttribute . '=' . $search; } else { foreach ($searchAttributes as $attribute) { // wildcards don't work with some attributes - $filter[] = $attribute . '=' . $originalSearch; + if ($originalSearch !== '') { + $filter[] = $attribute . '=' . $originalSearch; + } $filter[] = $attribute . '=' . $search; } }