Skip to content

Commit

Permalink
bug #27847 [Security] Fix accepting null as $uidKey in LdapUserProvid…
Browse files Browse the repository at this point in the history
…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
Robin Chalas committed Jul 5, 2018
2 parents 4ce5a1b + c776259 commit 8a96fdc
Showing 1 changed file with 5 additions and 1 deletion.
Expand Up @@ -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;
Expand Down

0 comments on commit 8a96fdc

Please sign in to comment.