Encoding subject without modifying original, fixes #4489

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6683 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
mariano.iglesias 2008-04-17 22:12:58 +00:00
parent 9af317b1b4
commit 5f967487bb

View file

@ -288,7 +288,6 @@ class EmailComponent extends Object{
* @access public
*/
function send($content = null, $template = null, $layout = null) {
$this->subject = $this->__encode($this->subject);
$this->__createHeader();
if ($template) {
@ -458,7 +457,7 @@ class EmailComponent extends Object{
$this->__header .= 'Bcc: ' . substr($addresses, 2) . $this->_newLine;
}
if ($this->delivery == 'smtp') {
$this->__header .= 'Subject: ' . $this->subject . $this->_newLine;
$this->__header .= 'Subject: ' . $this->__encode($this->subject) . $this->_newLine;
}
$this->__header .= 'X-Mailer: ' . $this->xMailer . $this->_newLine;
@ -638,9 +637,9 @@ class EmailComponent extends Object{
*/
function __mail() {
if (ini_get('safe_mode')) {
return @mail($this->to, $this->subject, $this->__message, $this->__header);
return @mail($this->to, $this->__encode($this->subject), $this->__message, $this->__header);
}
return @mail($this->to, $this->subject, $this->__message, $this->__header, $this->additionalParams);
return @mail($this->to, $this->__encode($this->subject), $this->__message, $this->__header, $this->additionalParams);
}
/**
* Sends out email via SMTP