mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Fix delivery issues with long subject lines and MailTransport.
A few people have reported issues sending wrapped messages via MailTransport. Removing the new lines has been suggested as a fix. Refs #2176
This commit is contained in:
parent
b4a0182bf0
commit
23b23d8050
2 changed files with 3 additions and 2 deletions
|
@ -42,9 +42,10 @@ class MailTransport extends AbstractTransport {
|
||||||
unset($headers['To']);
|
unset($headers['To']);
|
||||||
$headers = $this->_headersToString($headers, $eol);
|
$headers = $this->_headersToString($headers, $eol);
|
||||||
$message = implode($eol, $email->message());
|
$message = implode($eol, $email->message());
|
||||||
|
$subject = str_replace(array("\r", "\n"), '', $email->subject());
|
||||||
|
|
||||||
$params = isset($this->_config['additionalParameters']) ? $this->_config['additionalParameters'] : null;
|
$params = isset($this->_config['additionalParameters']) ? $this->_config['additionalParameters'] : null;
|
||||||
$this->_mail($to, $email->subject(), $message, $headers, $params);
|
$this->_mail($to, $subject, $message, $headers, $params);
|
||||||
return array('headers' => $headers, 'message' => $message);
|
return array('headers' => $headers, 'message' => $message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -69,7 +69,7 @@ class MailTransportTest extends CakeTestCase {
|
||||||
$data .= "Content-Transfer-Encoding: 8bit";
|
$data .= "Content-Transfer-Encoding: 8bit";
|
||||||
|
|
||||||
$subject = '=?UTF-8?B?Rm/DuCBCw6VyIELDqXogRm/DuCBCw6VyIELDqXogRm/DuCBCw6VyIELDqXog?=';
|
$subject = '=?UTF-8?B?Rm/DuCBCw6VyIELDqXogRm/DuCBCw6VyIELDqXogRm/DuCBCw6VyIELDqXog?=';
|
||||||
$subject .= "\r\n" . ' =?UTF-8?B?Rm/DuCBCw6VyIELDqXo=?=';
|
$subject .= ' =?UTF-8?B?Rm/DuCBCw6VyIELDqXo=?=';
|
||||||
$this->MailTransport->expects($this->once())->method('_mail')
|
$this->MailTransport->expects($this->once())->method('_mail')
|
||||||
->with(
|
->with(
|
||||||
'CakePHP <cake@cakephp.org>',
|
'CakePHP <cake@cakephp.org>',
|
||||||
|
|
Loading…
Reference in a new issue