summaryrefslogtreecommitdiff
path: root/program/steps/mail
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2012-11-12 09:16:22 +0100
committerAleksander Machniak <alec@alec.pl>2012-11-12 09:16:22 +0100
commit4340d5e63424ffdea2788701c5539c9cdc162eda (patch)
tree5f675ef121a45ae9f52e04864202ac56c07d75ea /program/steps/mail
parentd0751fba0e98ea312ade5c6d6fdb4169cb8b5756 (diff)
Fix excessive LFs at the end of composed message with top_posting=true (#1488797)
Diffstat (limited to 'program/steps/mail')
-rw-r--r--program/steps/mail/compose.inc10
-rw-r--r--program/steps/mail/func.inc2
2 files changed, 6 insertions, 6 deletions
diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc
index 2327debee..87a06e10d 100644
--- a/program/steps/mail/compose.inc
+++ b/program/steps/mail/compose.inc
@@ -906,9 +906,10 @@ function rcmail_create_reply_body($body, $bodyIsHtml)
if (!$bodyIsHtml) {
$body = preg_replace('/\r?\n/', "\n", $body);
+ $body = trim($body, "\n");
// soft-wrap and quote message text
- $body = rcmail_wrap_and_quote(rtrim($body, "\n"), $LINE_LENGTH);
+ $body = rcmail_wrap_and_quote($body, $LINE_LENGTH);
$prefix .= "\n";
$suffix = '';
@@ -953,8 +954,7 @@ function rcmail_create_forward_body($body, $bodyIsHtml)
$date = format_date($MESSAGE->headers->date, $RCMAIL->config->get('date_long'));
$charset = $RCMAIL->output->get_charset();
- if (!$bodyIsHtml)
- {
+ if (!$bodyIsHtml) {
$prefix = "\n\n\n-------- " . rcube_label('originalmessage') . " --------\n";
$prefix .= rcube_label('subject') . ': ' . $MESSAGE->subject . "\n";
$prefix .= rcube_label('date') . ': ' . $date . "\n";
@@ -967,9 +967,9 @@ function rcmail_create_forward_body($body, $bodyIsHtml)
$prefix .= rcube_label('replyto') . ': ' . $MESSAGE->get_header('replyto') . "\n";
$prefix .= "\n";
+ $body = trim($body, "\r\n");
}
- else
- {
+ else {
// set is_safe flag (we need this for html body washing)
rcmail_check_safe($MESSAGE);
// clean up html tags
diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc
index e4c4d8121..5e24a4311 100644
--- a/program/steps/mail/func.inc
+++ b/program/steps/mail/func.inc
@@ -1594,7 +1594,7 @@ function rcmail_wrap_and_quote($text, $length = 72)
$out .= $line . "\n";
}
- return $out;
+ return rtrim($out, "\n");
}