-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #47983: mixed LF and CRLF line endings in mail()
Email headers are supposed to be separated with CRLF. Period.
- Loading branch information
Showing
3 changed files
with
23 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--TEST-- | ||
Bug #47983 (mixed LF and CRLF line endings in mail()) | ||
--INI-- | ||
sendmail_path={MAIL:bug47983.out} | ||
--FILE-- | ||
<?php | ||
var_dump(mail('user@example.com', 'Test Subject', 'A Message', 'KHeaders')); | ||
$mail = file_get_contents('bug47983.out'); | ||
var_dump(preg_match_all('/(?<!\r)\n/', $mail)); | ||
?> | ||
--CLEAN-- | ||
<?php | ||
unlink('bug47983.out'); | ||
?> | ||
--EXPECT-- | ||
bool(true) | ||
int(0) |