Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Mime][BCBreak] Change of expected behaviour in address quoting since #39866 #41264

Closed
@althaus

Description

@althaus

Symfony version(s) affected: 4.4.23

Description

In PR #39866 a bugfix was introduced to add quoting of sender names to the Address::toString method. This breaks our current code which expects unquoted names. I understand why the change was applied, but I don't think that it should change the current behaviour of the toString method. We also rely on this for proper displaying where quotes aren't needed.

We now have doubled quoting in our test cases. In addition the fix quotes spaces which is not necessary at all.

How to reproduce

  1. Create a new address new Address('[email protected]', 'Test, Test')
  2. Have custom code that quotes the name if it contains special characters (see RFC 5322)
  3. The final string representation now contains doubled quotes: "\"Test, Test\" <[email protected]>"

Possible Solution

Introduce a new toQuotedString method or something similar.

Kind regards
Matthias

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