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 » HTTP » HTTP_Session » Bug #6778

DB container problem

Details

Submitted2006-02-14 10:42 UTC
Fromag at people dot pl
Assignedtroehr
StatusClosed
PackageHTTP_Session
PHP Version5.1.1
OSLinux
Roadmaps(Not assigned)

Comments

[2006-02-14 10:42 UTC] ag at people dot pl

Description:
------------
Hello,

I have just been starting to change the container (cookie -> db) and I have noticed some error there... When I tried to implement that I saw some error message like this:
Fatal error: Call to a member function quoteSmart() on a non-object in /srv/php/lib/php/HTTP/Session/Container/DB.php on line 179 (Strange error, google doesn't know it!)

I traced this problem and saw there is a little bug at _connect function. You assume 'dsn' is a string with db options. But it could be array too, with the same options (i.e.: http://pear.php.net/manual/en/package.database.db.intro-connect.php).

I suggest to change line 115 of this file
if (is_string($dsn)) {
into:
if (is_string($dsn) || (is_array($dsn)) {