mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
parent
6d69ec3a78
commit
f02a3b0531
2 changed files with 11 additions and 0 deletions
|
@ -1109,6 +1109,9 @@ class CakeEmail {
|
|||
$restore = mb_internal_encoding();
|
||||
mb_internal_encoding($this->_appCharset);
|
||||
}
|
||||
if (strpos($text, ',') !== false) {
|
||||
$text = '"' . $text . '"';
|
||||
}
|
||||
$return = mb_encode_mimeheader($text, $this->headerCharset, 'B');
|
||||
if ($internalEncoding) {
|
||||
mb_internal_encoding($restore);
|
||||
|
|
|
@ -277,6 +277,14 @@ class CakeEmailTest extends CakeTestCase {
|
|||
$expected = array('CakePHP <cake@cakephp.org>', 'Cake <php@cakephp.org>');
|
||||
$this->assertSame($expected, $result);
|
||||
|
||||
$result = $this->CakeEmail->formatAddress(array('me@example.com' => 'Last, First'));
|
||||
$expected = array('"Last, First" <me@example.com>');
|
||||
$this->assertSame($expected, $result);
|
||||
|
||||
$result = $this->CakeEmail->formatAddress(array('me@example.com' => 'Last First'));
|
||||
$expected = array('Last First <me@example.com>');
|
||||
$this->assertSame($expected, $result);
|
||||
|
||||
$result = $this->CakeEmail->formatAddress(array('cake@cakephp.org' => 'ÄÖÜTest'));
|
||||
$expected = array('=?UTF-8?B?w4TDlsOcVGVzdA==?= <cake@cakephp.org>');
|
||||
$this->assertSame($expected, $result);
|
||||
|
|
Loading…
Reference in a new issue