Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Mailer] Fix parsing Dsn with empty user/password#39531
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
OskarStark commentedDec 17, 2020
Ready to merge from my side 👍 |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
nicolas-grekas left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Now, I'm wondering why we should do this?
If ppl mess up with their DSN, that's their issue.
And if ppl have the empty string as user/pass, why prevent sending them?
Uh oh!
There was an error while loading.Please reload this page.
OskarStark commentedDec 17, 2020
Let me explain it while using an example from Notifier component based on this code: symfony/src/Symfony/Component/Notifier/Bridge/Sendinblue/SendinblueTransportFactory.php Lines 27 to 46 in29d62df
We provide a symfony/src/Symfony/Component/Notifier/Transport/AbstractTransportFactory.php Lines 47 to 65 in29d62df
And if it is null we throw an exception, but if it is an empty string this would not bubble up and and empty string in the password could lead to a bad experience. What I want to achieve with this PR is, that the user who implement this bridge can rely on the |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
fabpot commentedDec 17, 2020
Thank you@OskarStark. |
…Stark)This PR was squashed before being merged into the 5.1 branch.Discussion----------[Notifier] Fix parsing Dsn with empty user/password| Q | A| ------------- | ---| Branch? | 5.1| Bug fix? | yes| New feature? | no| Deprecations? | no| Tickets | ---| License | MIT| Doc PR | ---Same like#39531, but for Notifier component.I backported the DsnTest from `5.2` to `5.1`Commits-------a80409a [Notifier] Fix parsing Dsn with empty user/password
Uh oh!
There was an error while loading.Please reload this page.
While working on a PR for Notifier that user and password would be parsed as an empty string, which is not wrong, but not expected IMO. Thi
scheme://@symfony.comandscheme://:@symfony.comshould be a valid scheme with user and passnullAnother fix would be to check for
://@and://:@and throw anInvalidArgumentExceptionWDYT?The final solution will then be applied to the Notifier DSN in
5.1