Permalink
Browse files

Minor optimization for email linefeeds.

  • Loading branch information...
1 parent 9402f0a commit f3812342c226ec1d3355b84f60edfc54146095b7 @Phally Phally committed Jan 30, 2011
Showing with 4 additions and 9 deletions.
  1. +4 −9 cake/libs/controller/components/email.php
View
13 cake/libs/controller/components/email.php
@@ -159,15 +159,15 @@ class EmailComponent extends Object{
/**
* Line feed character(s) to be used when sending using mail() function
- * If null PHP_EOL is used.
+ * By default PHP_EOL is used.
* RFC2822 requires it to be CRLF but some Unix
* mail transfer agents replace LF by CRLF automatically
* (which leads to doubling CR if CRLF is used).
*
* @var string
* @access public
*/
- var $lineFeed = null;
+ var $lineFeed = PHP_EOL;
/**
* @deprecated see lineLength
@@ -819,13 +819,8 @@ function _strip($value, $message = false) {
* @access private
*/
function _mail() {
- if ($this->lineFeed === null) {
- $lineFeed = PHP_EOL;
- } else {
- $lineFeed = $this->lineFeed;
- }
- $header = implode($lineFeed, $this->__header);
- $message = implode($lineFeed, $this->__message);
+ $header = implode($this->lineFeed, $this->__header);
+ $message = implode($this->lineFeed, $this->__message);
if (is_array($this->to)) {
$to = implode(', ', array_map(array($this, '_formatAddress'), $this->to));
} else {

0 comments on commit f381234

Please sign in to comment.