From d47e1221803531dd30ef35a96af456ba4a3a8cdb Mon Sep 17 00:00:00 2001 From: Côme Chilliet Date: Thu, 29 Jun 2023 10:42:59 +0200 Subject: Avoid adding (attribute=) part to filter which will confuse LDAP servers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- apps/user_ldap/lib/Access.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'apps') diff --git a/apps/user_ldap/lib/Access.php b/apps/user_ldap/lib/Access.php index 3f120caefe6..40be2b9601a 100644 --- a/apps/user_ldap/lib/Access.php +++ b/apps/user_ldap/lib/Access.php @@ -1545,12 +1545,16 @@ class Access extends LDAPUtility { 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; } } -- cgit v1.2.3