PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Authentication » Auth » Bug #2186

dont use get_parent_class to check if its child of db_common

Details

Submitted2004-08-21 18:44 UTC
Frommattias dot guns at student dot kuleuven dot ac dot be
Assignedyavo
StatusClosed
PackageAuth
PHP Version4.3.7
OSLinux
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')) {