-
-
Notifications
You must be signed in to change notification settings - Fork 67
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
Fix AddressList toString method to quote semicolon #93
Conversation
NOTE: This is needed to switch to laminas-mail in the project I maintain: eventum/eventum#876 |
@glensc thanks for your contribution. Before we can accept the PR with need DCO to be valid on PRs in Laminas org. Please see https://github.com/laminas/laminas-mail/pull/93/checks?check_run_id=813642578 for more details. Thanks! |
@michalbundyra sure, those were fixup commits that I intended to flatten once Travis passed |
Signed-off-by: Elan Ruusamäe <glen@pld-linux.org>
if (! empty($name) && false !== strstr($name, ',')) { | ||
// quote $name if value requires so | ||
if (! empty($name) && (false !== strpos($name, ',') || false !== strpos($name, ';'))) { | ||
// FIXME: what if name contains double quote? |
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.
@glensc would be great, if you can provide another PR with a proper test case for that, thanks!
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.
@michalbundyra what you mean proper? what's wrong with the provided one? please be specific what you mean, test case for what exactly?
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.
@glensc sorry, I mean test with name which contains double quote, so separate issue.
As I understand this is about ;
in the name only.
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.
perhaps I remove this "FIXME" comment then it being out of scope? as the changeset does not introduce that as a new problem, the problem was there already before, I just noticed that and left a note.
besides I don't know how it should be encoded and at this point and I'm not interested in researching on, this PR has been waiting to be accepted by upstream way too long to get sidetracked with this.
Signed-off-by: Matthew Weier O'Phinney <matthew@weierophinney.net>
Signed-off-by: Matthew Weier O'Phinney <matthew@weierophinney.net>
This is port of zendframework/zend-mail#230 fixing regression from zendframework/zend-mail#147
Fixes #14
Certain input of
AddressList
headers, cannot be converted to string and back to header object because of incorrect quoting:gets incorrectly converted as
but
;
is address separator, so it needs to be quoted:The problem I discovered internally when using
Storage\Message
withHeaders
input, therefore testing that method is included in the unit test: