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

Bug #21212 Quiet "Call to undefined function dl()" fatal error when ldap extension missing
Submitted: 2017-05-17 18:42 UTC
From: chealer Assigned:
Status: Open Package: Net_LDAP2 (version 2.2.0)
PHP Version: 5.6.30 OS:
Roadmaps: (Not assigned)    
Subscription  


 [2017-05-17 18:42 UTC] chealer (Filipus Klutiero)
Description: ------------ Trying to connect calls checkLDAPExtension(). When the ldap PHP module is not present, a fatal error will occur unless the dl() function is available, due to a call to that function without checking its existence: if (!extension_loaded('ldap') && !dl('ldap.' . PHP_SHLIB_SUFFIX)) { return new Net_LDAP2_Error("It seems that you do not have the ldap-extension installed. Please install it before using the Net_LDAP2 package."); } else { return true; } Moreover, due to the use of the @ operator, that fatal error is suppressed, which typically means the requests yields a blank page. This bug is already present in 2.0.10. The dl function is missing when using XAMPP 5.6.30 on Windows, but is still present in some SAPI-s. This can be solved with: if (!extension_loaded('ldap') && (! function_exists('dl') || !@dl('ldap.' . PHP_SHLIB_SUFFIX))) { Or perhaps using PEAR::loadExtension().

Comments