Skip to content

Commit

Permalink
Remove CRLF from To headers in MailTransport.
Browse files Browse the repository at this point in the history
Like other header fields To should not contain CRLF.

Refs #2209
  • Loading branch information
markstory committed Nov 8, 2013
1 parent d7977c6 commit 407c420
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/Cake/Network/Email/MailTransport.php
Expand Up @@ -44,8 +44,10 @@ public function send(CakeEmail $email) {
$headers[$key] = str_replace(array("\r", "\n"), '', $header);
}
$headers = $this->_headersToString($headers, $eol);
$message = implode($eol, $email->message());
$subject = str_replace(array("\r", "\n"), '', $email->subject());
$to = str_replace(array("\r", "\n"), '', $to);

$message = implode($eol, $email->message());

$params = isset($this->_config['additionalParameters']) ? $this->_config['additionalParameters'] : null;
$this->_mail($to, $subject, $message, $headers, $params);
Expand Down

0 comments on commit 407c420

Please sign in to comment.