Skip to content
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

Merged
merged 1 commit into from
May 11, 2015

Conversation

weierophinney
Copy link
Member

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.

…ray()

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.
@Maks3w
Copy link
Member

Maks3w commented May 11, 2015

👍

@Maks3w Maks3w added this to the 2.4.2 milestone May 11, 2015
@weierophinney weierophinney merged commit 790d2a1 into zendframework:master May 11, 2015
weierophinney added a commit that referenced this pull request May 11, 2015
@weierophinney weierophinney deleted the hotfix/7503 branch May 11, 2015 15:10
weierophinney added a commit to zendframework/zend-mail that referenced this pull request May 14, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants