SendmailMailer: use CRLF endings for php >= 8.0#83
Merged
dg merged 1 commit intonette:masterfrom Apr 16, 2021
Merged
Conversation
dg
reviewed
Apr 15, 2021
| str_replace(Message::EOL, PHP_EOL, (string) $mail->getEncodedHeader('Subject')), | ||
| str_replace(Message::EOL, PHP_EOL, $parts[1]), | ||
| str_replace(Message::EOL, PHP_EOL, $parts[0]), | ||
| str_replace(Message::EOL, PHP_VERSION_ID >= 80000 ? "\r\n" : PHP_EOL, $parts[0]), |
Member
There was a problem hiding this comment.
Does this also apply to other parameters? Then it would probably be best to remove the workaround and use: (I mean in master)
$args = [
(string) $mail->getEncodedHeader('To'),
(string) $mail->getEncodedHeader('Subject'),
$parts[1],
$parts[0],
];
Contributor
Author
There was a problem hiding this comment.
As far as I know, this issue is related only to $additional_headers.
dg
pushed a commit
that referenced
this pull request
Apr 16, 2021
Co-authored-by: Ondřej Čech <ondrej.cech@glami.cz>
dg
pushed a commit
that referenced
this pull request
Apr 16, 2021
Co-authored-by: Ondřej Čech <ondrej.cech@glami.cz>
Contributor
|
Hello, can you release the new version with fix this bug? :-) |
Member
|
done |
Contributor
|
Thanks! 😁 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Version: PHP 8.
OS: Not Windows! Must be one where
PHP_EOLis not set to\r\n.Bug Description
Since this update in PHP8 https://git.php.net/?p=php-src.git;a=commit;h=6983ae751cd301886c966b84367fc7aaa1273b2d which addressed bug https://bugs.php.net/bug.php?id=47983 mail headers must be separated by CRLF. Without CRLF the headers are separated by space.
Steps To Reproduce
Run the following code:
Expected Behavior
An HTML-formatted email.
Actual result
The email is missing the header and is treated as plaintext. The boundaries and the encoded mime-part contents show up in the message:
TBH there's no test as I'm not able to create a simple test case for sending and receiving email.