Skip to content

Commit 8d86d50

Browse files
committed
Corrects LDAP option bug by retrieving the constant value.
ldap_set_option expects an integer value to be provided for the option. This change properly looked up the integer value based on the name of the constant being passed.
1 parent 9dc582d commit 8d86d50

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

phpmyfaq/inc/PMF/Ldap.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public function connect($ldapServer, $ldapPort, $ldapBase, $ldapUser = '', $ldap
118118
// optionally set Bind version
119119
if (isset($this->_ldapConfig['ldap_options'])) {
120120
foreach ($this->_ldapConfig['ldap_options'] as $key => $value) {
121-
if (! ldap_set_option($this->ds, $key, $value)) {
121+
if (! ldap_set_option($this->ds, constant($key), $value)) {
122122
$this->errno = ldap_errno($this->ds);
123123
$this->error = sprintf(
124124
'Unable to set LDAP option "%s" to "%s" (Error: %s).',
@@ -311,4 +311,4 @@ public function quote($string)
311311
$string
312312
);
313313
}
314-
}
314+
}

0 commit comments

Comments
 (0)