Closed
Description
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
- Create a new address
new Address('test@example.org', 'Test, Test')
- Have custom code that quotes the name if it contains special characters (see RFC 5322)
- The final string representation now contains doubled quotes:
"\"Test, Test\" <test@example.org>"
Possible Solution
Introduce a new toQuotedString
method or something similar.
Kind regards
Matthias