php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #51604 newline in end of header is shown in start of message
Submitted: 2010-04-19 20:49 UTC Modified: 2010-04-22 04:23 UTC
From: pavol at klacansky dot com Assigned: aharvey (profile)
Status: Closed Package: Mail related
PHP Version: 5.3.2 OS: Ubuntu
Private report: No CVE-ID: None
 [2010-04-19 20:49 UTC] pavol at klacansky dot com
Description:
------------
if I have a newline (\n) at the end of last header, it will show to start of message of mail

Test script:
---------------
<?php
$email = 'ufo@ufo.net';
$headers = 'From: ' . $email . "\n";
$headers .= 'Cc: ' . $email . "\n";
$headers .= 'X-Mailer: PHP/' . phpversion() . "\n";
$headers .= 'Content-Type: text/plain; charset=utf-8' . "\n";
$headers .= 'Content-Transfer-Encoding: 8bit' . "\n";
mail('test@test.tt', 'test', 'Hallo', $headers);
?>

Expected result:
----------------
Hallo

Actual result:
--------------
Hallo

Patches

php_bug51604.diff (last revision 2010-04-21 14:00 UTC by degeberg@php.net)

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-04-19 20:50 UTC] pavol at klacansky dot com
Actual result:
--------------
\nHallo
 [2010-04-21 16:00 UTC] degeberg@php.net
The following patch has been added/updated:

Patch Name: php_bug51604.diff
Revision:   1271858442
URL:        http://bugs.php.net/patch-display.php?bug=51604&patch=php_bug51604.diff&revision=1271858442
 [2010-04-21 16:01 UTC] degeberg@php.net
The attached patch will fix this issue. I don't have php-src karma, so I can't commit it myself.
 [2010-04-22 04:05 UTC] aharvey@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: aharvey
 [2010-04-22 04:22 UTC] aharvey@php.net
Automatic comment from SVN on behalf of aharvey
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=298291
Log: Fix for bug #51604 (newline in end of header is shown in start of message).
Patch by Daniel Egeberg.
 [2010-04-22 04:23 UTC] aharvey@php.net
-Status: Assigned +Status: Closed
 [2010-04-22 04:23 UTC] aharvey@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.

Thanks for the patch, Daniel.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 10:01:29 2024 UTC