From c26e68587ba11b0f39d61535beacc45433bf1973 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Fri, 4 Sep 2009 10:05:23 -0600 Subject: [PATCH] Trim reply/forward body text --- imp/docs/CHANGES | 2 +- imp/lib/Compose.php | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/imp/docs/CHANGES b/imp/docs/CHANGES index 30ac34745..ec2fe4ab3 100644 --- a/imp/docs/CHANGES +++ b/imp/docs/CHANGES @@ -46,7 +46,7 @@ v5.0-git [mms] Fix wrong charset on filenames when stripping attachments (Bug #7220). [mms] Use effects queue to prevent issues with users clicking on effects elements too quickly. -[mms] Trim leading/trailing whitespace from reply text. +[mms] Trim leading/trailing whitespace from reply/forwarded text. [mms] Add full IMAP message flagging capabilities to DIMP. [mms] Decode IDN (RFC 3490) names in addresses (Request #5836). [mms] Add ability to download attachments in MIMP (Request #2925). diff --git a/imp/lib/Compose.php b/imp/lib/Compose.php index 28c2291e8..dd0c45c3e 100644 --- a/imp/lib/Compose.php +++ b/imp/lib/Compose.php @@ -2223,13 +2223,12 @@ class IMP_Compose $type = 'text/plain'; } - if ($type == 'text/plain') { - /* For replies, remove all leading/trailing whitespace. This - * doesn't add anything to reply data. */ - if ($options['type'] == 'reply') { - $msg = trim($msg); - } + /* Always remove leading/trailing whitespace. The data in the + * message body is not intended to be the exact representation of the + * original message (use forward as message/rfc822 part for that). */ + $msg = trim($msg); + if ($type == 'text/plain') { if ($part->getContentTypeParameter('format') == 'flowed') { $flowed = new Horde_Text_Flowed($msg); if (Horde_String::lower($part->getContentTypeParameter('delsp')) == 'yes') { -- 2.11.0