DB.php->parseDSN problem (bug?)

[email protected] ("Tomas V.V.Cox") Thu, 01 Mar 2001 00:54:36 +0100
Newsgroups php.pear
Message-ID <[email protected]>
Hi all again,

During the tests of the ifx.php (informix pear DB class) I found one
problem with the actual parseDSN function. One example for informix
connect data is:
user: foo
pass: bar
hostspec: host.com
database: /usr/test/general.db

So the DSN for that is:
ifx://foo:[email protected]/usr/test/general.db

The problem is that the actual regex:
if (preg_match("|^(.*)/([^/]+)/?$|", $dsn, $arr)) {
    $parsed["database"] = $arr[2];
    $dsn = $arr[1];
}
Gets: general.db as the database and host.com/usr/test as the host, that
is obviuosly wrong. Just for notice, probably in other evironments,
database names could be: c:\dbs\foo.db.

Tomas V.V.Cox