Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Fix email headers when using long email subjects and \r\n as crlf. #1709
When using long email subjects and \r\n as crlf, the header is badly formatted, and either the email appears with headers on the body, or doesn't arrive at all.
The problem is that on the preg_replace, the multiline mode only matches the \n leaving the \r to be matched on the regex.
I'm showing the part of the header where the subject is set.
Current Code (notice the ^M on the first two lines)