Skip to content

Commit

Permalink
MAGETWO-72477: Bogus emails generated when the recipient name contain…
Browse files Browse the repository at this point in the history
…s special characters
  • Loading branch information
Bohdan Korablov committed Sep 20, 2017
1 parent e95e842 commit f866101
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Framework\Mail;

class MessageTest extends \PHPUnit\Framework\TestCase
{
/**
* @var Message
*/
private $message;

/**
* @inheritdoc
*/
protected function setUp()
{
$this->message = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
->create(Message::class);
}

public function testGetHeaderEncodingDefaultValue()
{
$this->assertEquals(\Zend_Mime::ENCODING_BASE64, $this->message->getHeaderEncoding());
}

public function testGetCharsetDefaultValue()
{
$this->assertEquals('utf-8', $this->message->getCharset());
}
}
1 change: 1 addition & 0 deletions lib/internal/Magento/Framework/Mail/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class Message extends \Zend_Mail implements MessageInterface
public function __construct($charset = 'utf-8')
{
parent::__construct($charset);
$this->setHeaderEncoding(\Zend_Mime::ENCODING_BASE64);
}

/**
Expand Down

0 comments on commit f866101

Please sign in to comment.