Trim reply/forward body text
authorMichael M Slusarz <slusarz@curecanti.org>
Fri, 4 Sep 2009 16:05:23 +0000 (10:05 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Mon, 7 Sep 2009 09:46:45 +0000 (03:46 -0600)
imp/docs/CHANGES
imp/lib/Compose.php

index 30ac347..ec2fe4a 100644 (file)
@@ -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).
index 28c2291..dd0c45c 100644 (file)
@@ -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') {