Browse Source

Remove CRLF from To headers in MailTransport.

Like other header fields To should not contain CRLF.

Refs #2209
mark_story 12 years ago
parent
commit
407c420176
1 changed files with 3 additions and 1 deletions
  1. 3 1
      lib/Cake/Network/Email/MailTransport.php

+ 3 - 1
lib/Cake/Network/Email/MailTransport.php

@@ -44,8 +44,10 @@ class MailTransport extends AbstractTransport {
 			$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);