Only set the cached instance if driver is valid
commitef365a5940d9146d00cf03c9da4315c360bf50a1
authorMatthias Beyer <matthias@ib-fb.de>
Thu, 19 Sep 2013 09:11:44 +0000 (19 11:11 +0200)
committerMatthias Beyer <matthias@ib-fb.de>
Thu, 19 Sep 2013 09:11:44 +0000 (19 11:11 +0200)
treeaf41b701f0e7a367bac4411f1ee6d6b712153f77
parent953b922a1371c5181158b2a50747b14237d82e7a
Only set the cached instance if driver is valid

As I could see at other locations in the code, the ldap driver instance
can be invalid. And if the instance is invalid, the getStaticLdap()
function gets called again. Caching would prevent the function from
retrying to initiate the ldapDrivers object.

This commit adds conditional caching: only if the ldap driver instance is
valid, the object gets cached. This ensures that a retry with this function
would really try to create a new ldapDrivers object and not simply
return the (invalid) cached one.
inc/drivers_ldap.php