Home » Authentication » Auth » Bug #2186
dont use get_parent_class to check if its child of db_common
Details
| Submitted | 2004-08-21 18:44 UTC |
|---|---|
| From | mattias dot guns at student dot kuleuven dot ac dot be |
| Assigned | yavo |
| Status | Closed |
| Package | Auth |
| PHP Version | 4.3.7 |
| OS | Linux |
| Roadmaps | (Not assigned) |
Comments
[2004-08-21 18:44 UTC] mattias dot guns at student dot kuleuven dot ac dot be
Description:
------------
A class which is not a direct child from db_common is not accepted as a valid $dsn object.
Reproduce code:
---------------
(cvs version)
in Auth/Container/DB.php
line 96:
} elseif (strtolower(get_parent_class($dsn)) == "db_common") {
get_parent_class is not the right way to check if the potential object in $dsn is a child from db_common.
For example the db_ldap3 class is a child of db_ldap2, and db_ldap2 is a child of db_common.
In order for auth to work with an object from db_ldap3 or another 'younger' class, the function is_subclass_of should be used (compatible with php5) :
} elseif (is_subclass_of($dsn,'db_common')) {