-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Mime][BCBreak] Change of expected behaviour in address quoting since #39866 #41264
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@YaFou could you please have a look? Thanks 🙏 |
@althaus So if I understood well, you want quotes to be displayed only if there are special characters in the address? In my opinion, a |
@YaFou My issue is that your PR changed the fundamental behaviour of the method and makes a lot of our tests fail. Sending a properly quoted string before resulted in a valid string representation: new Address('test@example.org', '"Test, Test"') After your PR this renders double quoted. Our main concern isn't what the method is doing, but rather that it changed in a patch release, where you can dicuss if it really was broken or not before. |
I understand your issue. Nevertheless, there is still one issue: how do we know if the user adds intentionally quotes to escape special characters or it adds them because quotes are in the part of the name? I don't see any solutions except adding a new static method for example that takes into account quotes around the name and if they exist, don't add unnecessary quotes. |
TBH I am not sure how to proceed here. cc @fabpot |
Any news how to get this resolved in any way? @YaFou @OskarStark @fabpot This little issue is blocking as from upgrading from Symfony 4.4.22. |
As @OskarStark, I wait a review from another maintainer for his opinion. However, I will give a try to fix this issue @althaus 😃 |
Hey, thanks for your report! |
Yes, although I've work around this internally with some vodoo to detect what the library is doing, it'd be great to have a clean solution. |
Could you try sending a fix @althaus ? |
@nicolas-grekas I'm not sure how to resolve this in a clean fashion now. The commit changed existing behaviour and I don't think that you can revert it again. So we'd either add a new factory method or a new toTbdString method. |
Hey, thanks for your report! |
Hello? This issue is about to be closed if nobody replies. |
Hey, I didn't hear anything so I'm going to close it. Feel free to comment if this is still relevant, I can always reopen! |
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 thetoString
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
new Address('test@example.org', 'Test, Test')
"\"Test, Test\" <test@example.org>"
Possible Solution
Introduce a new
toQuotedString
method or something similar.Kind regards
Matthias
The text was updated successfully, but these errors were encountered: