Project

General

Profile

Bug #22064 » 13435_v5.diff

Administrator Admin, 2010-02-17 21:09

View differences:

t3lib/class.t3lib_htmlmail.php (working copy)
// From
if ($this->from_email) {
if ($this->from_name && !t3lib_div::isBrokenEmailEnvironment()) {
$this->add_header('From: '.$this->from_name.' <'.$this->from_email.'>');
$from = $this->quoteStringWithComma($this->from_name);
$this->add_header('From: ' . $from . ' <' . $this->from_email . '>');
} else {
$this->add_header('From: '.$this->from_email);
$this->add_header('From: ' . $this->from_email);
}
}
......
// Reply
if ($this->replyto_email) {
if ($this->replyto_name) {
$this->add_header('Reply-To: '.$this->replyto_name.' <'.$this->replyto_email.'>');
$replyTo = $this->quoteStringWithComma($this->replyto_name);
$this->add_header('Reply-To: ' . $replyTo . ' <' . $this->replyto_email . '>');
} else {
$this->add_header('Reply-To: '.$this->replyto_email);
$this->add_header('Reply-To: ' . $this->replyto_email);
}
}
// Organisation
......
}
}
/**
* Returns a string wrapped inside quotes if it contains a comma character. Any '"'
* characters will be removed inside the string if it must be quoted.
*
* @param string $string the text
* @return string
*/
protected function quoteStringWithComma($string) {
if (strpos($string, ',') !== FALSE) {
$string = '"' . str_replace('"', '', $string) . '"';
}
return $string;
}
/**
* Sets the recipient(s). If you supply a string, you set one recipient.
* If you supply an array, every value is added as a recipient.
(3-3/3)