Skip to content

Potential Issue with URL Decoding in DSN Handling #52537

@roukmoute

Description

@roukmoute

Symfony version(s) affected

>= 4.4

Description

There seems to be an inconsistency in the handling of special characters in the DSN within the Symfony Mailer component. According to the Mailer Documentation, special characters in the host (like /) should be URL-encoded. However, upon inspecting the source code, it appears that $parsedDsn['host'] is not URL-decoded.

How to reproduce

  • Create a DSN string with special characters like api.example%2Ffoo%2Fbar%2Fbaz, etc., in the host.
  • Pass this DSN string to the Mailer component.
  • Observe that the DSN parsing does not URL-decode the host.

Possible Solution

Additional Context

I am willing to create a Pull Request to address this issue if the Symfony team agrees that this behavior needs correction.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions