note 62875 deleted from function.mail by tularis
| From: | tularis@php.net | Date: | Sun, 11 Jan 2015 15:26:40 +0000 |
| Subject: | note 62875 deleted from function.mail by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-201405@lists.php.net to get a copy of this message | ||
Note Submitter: Nimlhug
----
As noted in other, well, notes; the "additional headers" parameter can be easily
exploited, when doing things like:
<?php
mail( $_POST['to'], $_POST['subject'], $_POST['message'],
'Reply-to: '.$_POST['from']."\r\n" );
?>
An easy way of fixing this, is removing CRLFs from the header-strings, like so:
<?php
$_POST['from'] = str_replace( "\r\n", '', $_POST['from']
);
?>
This way, the extra data will be part of the previous header.