Skip to content

Commit

Permalink
Support to multibyte in subject.
Browse files Browse the repository at this point in the history
  • Loading branch information
jrbasso committed Apr 17, 2011
1 parent c48db36 commit d5938dd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Cake/Network/CakeEmail.php
Expand Up @@ -475,7 +475,7 @@ public function subject($subject = null) {
if ($subject === null) {
return $this->_subject;
}
$this->_subject = (string)$subject;
$this->_subject = $this->_encode((string)$subject);
return $this;
}

Expand Down
4 changes: 4 additions & 0 deletions lib/Cake/tests/Case/Network/CakeEmailTest.php
Expand Up @@ -342,6 +342,10 @@ public function testSubject() {
$result = $this->CakeEmail->subject(array('something'));
$this->assertIdentical($this->CakeEmail->subject(), 'Array');
$this->assertIdentical($this->CakeEmail, $result);

$this->CakeEmail->subject('هذه رسالة بعنوان طويل مرسل للمستلم');
$expected = '=?UTF-8?B?2YfYsNmHINix2LPYp9mE2Kkg2KjYudmG2YjYp9mGINi32YjZitmEINmF2LE=?=' . "\r\n" . ' =?UTF-8?B?2LPZhCDZhNmE2YXYs9iq2YTZhQ==?=';
$this->assertIdentical($this->CakeEmail->subject(), $expected);
}

/**
Expand Down

0 comments on commit d5938dd

Please sign in to comment.