Part of the EllisLab Network

Bug Report

Set Newline Bug

Date: 05/03/2007 Severity: Trivial
Status: Resolved Reporter: mstclaire
Version: 1.5.3
Keywords: Libraries, Email Class

Description

In core library Email, line 487 does not allow override of “\n” character because of OR conditions. These or conditions should be && (AND) conditions. See block below from line 487 - 493.

Code Sample

if ($newline != "\n" OR $newline != "\r\n" OR $newline != "\r")
{
    $this
->newline    = "\n";    
    return;
}
    
$this
->newline    = $newline;

Expected Result

$this->newline = “\r\n” if set_newline(”\r\n\”)

Actual Result

$this->newline = “\n” if set_newline(”\r\n\”)

Comment on Bug Report

Page 1 of 1 pages
Posted by: Geert De Deckere on 4 May 2007 10:34am
Geert De Deckere's avatar

Bug approved by me.

Alternative fix:

if (!in_array($newline, array("\r", "\r\n"))
{
    $this
->newline    = "\n";    
    return;
}

$this
->newline    = $newline;

Note that you can leave “\n” out of the array. One option less to check for.

Name:

Email:

Location:

URL:

Remember my personal information

Notify me of follow-up comments?