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 » Database » DB » Bug #1826

If Database in string DSN has '=' won't work

Details

Submitted2004-07-08 20:20 UTC
Fromtdr32 at cs dot byu dot edu
Assigneddanielc
StatusClosed
PackageDB
PHP Version4.3.2
OSFedora Core 2
Roadmaps(Not assigned)

Comments

[2004-07-08 20:20 UTC] tdr32 at cs dot byu dot edu

Description:
------------
I am trying to connect to a ldap database using the DB_LDAP, but am having trouble accessing the database. When I pass my database as ou=people,dc=edu,dc=cs, only the ou is passing through. I changed this to ou%3dpeople,dc%3dedu,dc%3dcs and the whole string made it in to the DSN, but it didn't change it back to '=' like it did with my passwords and usernames.

Reproduce code:
---------------
I fixed it by changing 668 and 671 in DB.php to run the $dsn through rawurlencode, like it does with passwords and users.

if (($pos = strpos($dsn, '?')) === false) {
$parsed['database'] = rawurldecode($dsn);
// /database?param1=value1&param2=value2
} else {
$parsed['database'] = rawurldecode(substr($dsn, 0, $pos));

[2004-07-08 20:23 UTC] tdr32 at cs dot byu dot edu

Put the wrong email

[2004-07-08 20:51 UTC] tdr32 at cs dot byu dot edu

ldap://cn%3dme,dc%3dcs,dc%3dbyu,dc%3dedu:password@ldap:380/ou%3dpeople,dc%3dcs,dc%3dbyu,dc%3dedu

I am using DB_DataObject with DB_LDAP. If I change the %3d to '=' in my database, then the parse_ini_file won't pick it up. But with the %3d, it needs the rawurldecode() function.

[2004-07-08 20:52 UTC] tdr32 at cs dot byu dot edu

ldap://cn=me,dc=cs,dc=byu,dc=edu:password@ldap:380/ou=people,d
c=cs,dc=byu,dc=edu is how it should look without the encoding.

[2004-07-08 21:01 UTC] tdr32 at cs dot byu dot edu

Sorry, didn't see the request. I am using DB 1.6.4