Ticket #550 (closed Bug: fixed)

Opened 8 months ago

Last modified 7 months ago

DSN does not support passwords with the 'at sign' (@)

Reported by: alias Owned by: JAAulde
Priority: minor Milestone: 2.1.2
Component: Libraries:Database Version: SVN HEAD
Keywords: dsn database db password at Cc:

Description

the current db configuration mode (DSN, driver://user:password@server/database) does not allow the passwords to have 'at signs' (@) for obvious reasons (the DSN string then looks like mysql://user:p@ssword@server/database, which doesn't work of course).

I don't think that is a HUGE problem, but still, it would be nice if the password complexity wasn't limited by such a minor problem.

Attachments

Database.php.diff (4.8 kB) - added by JAAulde 7 months ago.
Database library changes
databaseconfig.php.diff (1.3 kB) - added by JAAulde 7 months ago.
Config file changes

Change History

Changed 8 months ago by Shadowhand

Ideally, connection should be either a DSN or an array of connection parameters. This would allow this change to be merged into 2.1.2, without switching the database configuration API.

Thanks alias!

Changed 7 months ago by Xobb

Password escaping

If your database, option values, username or password contain characters used to delineate DSN parts, you can escape them via URI hex encodings:

: = %3a / = %2f @ = %40 + = %2b ( = %28 ) = %29 ? = %3f = = %3d & = %26

Changed 7 months ago by JAAulde

  • owner changed from zombor to JAAulde

and awayyyy i go!

Changed 7 months ago by JAAulde

Database library changes

Changed 7 months ago by JAAulde

Config file changes

Changed 7 months ago by JAAulde

Modified the config file and library to handle 'connection' array now.

config/database.php: The config can have an array of connection parameters or a DSN as it's 'connection'

libraries/Database.php: The constructor (and instance) can now take the following as a paramater:

*array like that found in the config file *array of connection paramaters only (to be merged with default config) *DSN string (to be merged with default config) *name of a config group from config file to use

DIFFs attached

Changed 7 months ago by JAAulde

  • status changed from new to closed
  • resolution set to fixed

All fixed up...

Attached diffs Comitted to trunk in r2526 and merged to releases/2.1.2 in r2527

Changed 7 months ago by JAAulde

Edit to above note... only r2526 was merged. r2525 (the config change) was involved in this, but not meant for 2.1.2

Note: See TracTickets for help on using tickets.