summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2023-06-29 10:42:59 +0200
committerbackportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com>2023-08-08 07:40:19 +0000
commitd47e1221803531dd30ef35a96af456ba4a3a8cdb (patch)
treeb9c4e6a15e95aee4cad823860769184a3b7f9895 /apps/user_ldap
parent6136a8fed21df685612ed2c4baba25ea2c0e4c51 (diff)
downloadnextcloud-server-d47e1221803531dd30ef35a96af456ba4a3a8cdb.tar.gz
nextcloud-server-d47e1221803531dd30ef35a96af456ba4a3a8cdb.zip
Avoid adding (attribute=) part to filter which will confuse LDAP servers
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
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 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;
}
}