Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 2.2.0

Bug #15364 setLDAPVersion fails / string instead of array
Submitted: 2008-12-20 17:42 UTC
From: cweiske Assigned: cweiske
Status: Closed Package: Net_LDAP2 (version 2.0.0RC4)
PHP Version: 5.2.8 OS:
Roadmaps: 2.0.0    
Subscription  


 [2008-12-20 17:42 UTC] cweiske (Christian Weiske)
Description: ------------ Net_LDAP2::setLDAPVersion() failed for me because > $rootDSE->getValue('supportedLDAPVersion'); was a string instead of an array. The following in_array call fails therefore. I use and connect to openldap in version 2.3.43. Expected result: ---------------- Fix: > if (in_array($version, (array)$supported_versions)) { Actual result: -------------- Code breaking it for me: > if (in_array($version, $supported_versions)) {

Comments

 [2008-12-22 08:57 UTC] beni (Benedikt Hallinger)
Thanks for submitting that bug! However, it should be already fixed since several releases. Current code is: $supported_versions = $rootDSE->getValue('supportedLDAPVersion'); if (is_string($supported_versions)) { $supported_versions = array($supported_versions); } if (in_array($version, $supported_versions)) { return $this->setOption("LDAP_OPT_PROTOCOL_VERSION", $version); } else { return $this->raiseError("LDAP Server does not support protocol version " . $version); } Which should catch your error. Please verify, that you have the latest version and the issue exists there.
 [2008-12-22 10:52 UTC] cweiske (Christian Weiske)
Net_LDAP2-2.0.0RC4 does not have that fix. I'll try cvs head today at home.
 [2008-12-25 09:40 UTC] cweiske (Christian Weiske)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better. It does indeed work with current CVS.