Permalink
Browse files

Remove CRLF from To headers in MailTransport.

Like other header fields To should not contain CRLF.

Refs #2209
  • Loading branch information...
1 parent d7977c6 commit 407c4201763f0f816edbe39ffb8cd6fa773f33a0 @markstory markstory committed Nov 8, 2013
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/Cake/Network/Email/MailTransport.php
@@ -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);

0 comments on commit 407c420

Please sign in to comment.