Permalink
Browse files

bug #27847 [Security] Fix accepting null as $uidKey in LdapUserProvid…

…er (louhde)

This PR was merged into the 4.0 branch.

Discussion
----------

[Security] Fix accepting null as $uidKey in LdapUserProvider

| Q             | A
| ------------- | ---
| Branch?       | 4.0
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Fixing the hard BC break introduced in afeb89f#diff-96df7b4cb1c79ec0877d79ae2b61899dL40

Commits
-------

c776259 [Security] LdapUserProvider uidKey could be null
  • Loading branch information...
chalasr committed Jul 5, 2018
2 parents 4ce5a1b + c776259 commit 8a96fdcd5e54bffccf12824265435516697cbddd
Showing with 5 additions and 1 deletion.
  1. +5 −1 src/Symfony/Component/Security/Core/User/LdapUserProvider.php
@@ -35,8 +35,12 @@ class LdapUserProvider implements UserProviderInterface
private $defaultSearch;
private $passwordAttribute;
public function __construct(LdapInterface $ldap, string $baseDn, string $searchDn = null, string $searchPassword = null, array $defaultRoles = array(), string $uidKey = 'sAMAccountName', string $filter = '({uid_key}={username})', string $passwordAttribute = null)
public function __construct(LdapInterface $ldap, string $baseDn, string $searchDn = null, string $searchPassword = null, array $defaultRoles = array(), ?string $uidKey = 'sAMAccountName', string $filter = '({uid_key}={username})', string $passwordAttribute = null)
{
if (null === $uidKey) {
$uidKey = 'sAMAccountName';
}
$this->ldap = $ldap;
$this->baseDn = $baseDn;
$this->searchDn = $searchDn;

0 comments on commit 8a96fdc

Please sign in to comment.