Skip to content
This repository was archived by the owner on May 31, 2024. It is now read-only.

Commit 83f9f92

Browse files
authored
Update LdapBindAuthenticationProvider.php
1 parent 47cdba6 commit 83f9f92

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Core/Authentication/Provider/LdapBindAuthenticationProvider.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,8 @@ protected function checkAuthentication(UserInterface $user, UsernamePasswordToke
8787
}
8888

8989
try {
90-
$username = $this->ldap->escape($username, '', LdapInterface::ESCAPE_DN);
91-
9290
if ($this->queryString) {
91+
$username = $this->ldap->escape($username, '', LdapInterface::ESCAPE_FILTER);
9392
$query = str_replace('{username}', $username, $this->queryString);
9493
$result = $this->ldap->query($this->dnString, $query)->execute();
9594
if (1 !== $result->count()) {
@@ -98,6 +97,7 @@ protected function checkAuthentication(UserInterface $user, UsernamePasswordToke
9897

9998
$dn = $result[0]->getDn();
10099
} else {
100+
$username = $this->ldap->escape($username, '', LdapInterface::ESCAPE_DN);
101101
$dn = str_replace('{username}', $username, $this->dnString);
102102
}
103103

0 commit comments

Comments
 (0)