bug #16442 [LDAP] ldap_set_option should be called with a valid link identifier (pierredup)

This PR was merged into the 2.8 branch.

Discussion
----------

[LDAP] ldap_set_option should be called with a valid link identifier

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

Commits
-------

7f89196 ldap_set_option should be called with a valid link identifier
This commit is contained in:
Fabien Potencier 2015-11-05 14:32:43 +01:00
commit 8c4e756c1b

View File

@ -109,11 +109,11 @@ class LdapClient implements LdapClientInterface
$host = 'ldaps://'.$host;
}
$this->connection = ldap_connect($host, $this->port);
ldap_set_option($this->connection, LDAP_OPT_PROTOCOL_VERSION, $this->version);
ldap_set_option($this->connection, LDAP_OPT_REFERRALS, $this->optReferrals);
$this->connection = ldap_connect($host, $this->port);
if ($this->useStartTls) {
ldap_start_tls($this->connection);
}