aboutsummaryrefslogtreecommitdiffstats
path: root/apps/user_ldap
diff options
context:
space:
mode:
authorCôme Chilliet <91878298+come-nc@users.noreply.github.com>2023-08-08 09:21:20 +0200
committerGitHub <noreply@github.com>2023-08-08 09:21:20 +0200
commitb155f87a84390fbd3e3791508e03363c33a60cf7 (patch)
treeb1e3c88b485ad55ff81e61fc6d3506f715150516 /apps/user_ldap
parentd7e2813eca2da348fde85472e7b9fcb9b4843a93 (diff)
parent4a0351878c8800e76a12669e12b4e41fa9c13b2f (diff)
downloadnextcloud-server-b155f87a84390fbd3e3791508e03363c33a60cf7.tar.gz
nextcloud-server-b155f87a84390fbd3e3791508e03363c33a60cf7.zip
Merge pull request #39058 from nextcloud/fix/fix-ldap-filters-for-empty-search
Avoid adding (attribute=) part to filter which will confuse LDAP servers
Diffstat (limited to 'apps/user_ldap')
-rw-r--r--apps/user_ldap/lib/Access.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/apps/user_ldap/lib/Access.php b/apps/user_ldap/lib/Access.php
index 3fbb003ed51..0b115c42764 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;
}
}