mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-11-07 22:41:59 +01:00
removeJournal should restore LF characters
Signed-off-by: Janos SUTO <sj@acts.hu>
This commit is contained in:
parent
79bf09fd53
commit
d1b0df1b41
@ -144,12 +144,22 @@ class Piler_Mime_Decode {
|
||||
public static function removeJournal(&$message, $EOL = "\n") {
|
||||
$has_journal = 0;
|
||||
|
||||
$crlfs = substr_count($message, "\r\n");
|
||||
|
||||
self::splitMessageRaw($message, $headers, $journal, $body);
|
||||
|
||||
if($journal) {
|
||||
$has_journal = 1;
|
||||
}
|
||||
|
||||
// If the message has >10 CRLF sequences, then we assume
|
||||
// that we need to restore the removed LF characters
|
||||
if($crlfs > 10) {
|
||||
$headers = str_replace("\n", "\r\n", $headers);
|
||||
$body = str_replace("\n", "\r\n", $body);
|
||||
$EOL = "\r\n";
|
||||
}
|
||||
|
||||
$message = $headers . $EOL . $EOL . $body;
|
||||
|
||||
return $has_journal;
|
||||
|
Loading…
Reference in New Issue
Block a user