This repository has been archived by the owner on Jan 8, 2020. It is now read-only.
[#7503] Pass the \r\n
sequence to Part::getHeadersAsArray()
#7514
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Per the gist provided by @Qronicle, I've created a unit test against
Zend\Mail\Message
, and a proposed fix.Zend\Mime\Part::getHeadersAsArray()
accepts an optional argument, the line separator sequence. This defaults to\n
, but for mail messages, should be\r\n
. The proposed patch passes that argument when retrieving MIME headers to include in the mail message.This is an alternative to #7510. That patch removes all header folding. In most cases, that should be acceptable, but in cases where the MIME boundary is long, the header could potentially exceed 998 bytes. The attached patch preserves header folding, by ensuring the correct sequence is used when aggregating MIME headers for use in a Mail message.