Cannot use DSN with URL-encoded password
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 4.5k
- Forks
- 884
- PR merge metrics
- No merged PRs in 30d
Description
Phinx supports passing connection options via dsn.
However, an URL-encoded password is passed through as is which lets the connection fail.
However, skipping the encoding would lead to ambiguous or broken DSN, e.g. if the password contains @:
mysql://root:p@ssword@localhost:3306/mydb?charset=utf8
Correct would be:
mysql://root:p%40ssword@localhost:3306/mydb?charset=utf8
In this case Phinx would literally use the password p%40ssword instead of p@ssword for the DB connection.
See e.g. the Doctrine DBAL DsnParser which properly URL decodes all URL parts.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no Phinx file or test; start by locating the DSN configuration and database-connection parsing entry points. Compare their URL-part handling with Doctrine DBAL's DsnParser, linked in the issue, and verify that an encoded password such as p%40ssword reaches the connection as p@ssword without making an unencoded DSN ambiguous.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100