Browse Source

slightly better reply wrapping

jmunro 23 years ago
parent
commit
841b670dba
1 changed files with 5 additions and 6 deletions
  1. 5 6
      src/compose.php

+ 5 - 6
src/compose.php

@@ -666,19 +666,18 @@ function newMail ($mailbox='', $passed_id='', $passed_ent_id='', $action='', $se
             }
             }
             /* this corrects some wrapping/quoting problems on replies */
             /* this corrects some wrapping/quoting problems on replies */
             $rewrap_body = explode("\n", $body);
             $rewrap_body = explode("\n", $body);
-
-	    $from =  (is_array($orig_header->from)) ? 
-	              $orig_header->from[0] : $orig_header->from;
+	        $from =  (is_array($orig_header->from)) ? 
+	                $orig_header->from[0] : $orig_header->from;
             $body = getReplyCitation($from->getAddress(false));
             $body = getReplyCitation($from->getAddress(false));
             sqUnWordWrap($body);
             sqUnWordWrap($body);
             $cnt = count($rewrap_body);
             $cnt = count($rewrap_body);
             for ($i=0;$i<$cnt;$i++) {
             for ($i=0;$i<$cnt;$i++) {
-              sqWordWrap($rewrap_body[$i], ($editor_size - 2));
+              sqWordWrap($rewrap_body[$i], ($editor_size));
                 if (preg_match("/^(>+)/", $rewrap_body[$i], $matches)) {
                 if (preg_match("/^(>+)/", $rewrap_body[$i], $matches)) {
                     $gt = $matches[1];
                     $gt = $matches[1];
-                    $body .= '>' . str_replace("\n", "\n>$gt ", $rewrap_body[$i]) ."\n";
+                    $body .= '>' . str_replace("\n", "\n>$gt ", rtrim($rewrap_body[$i])) ."\n";
                 } else {
                 } else {
-                    $body .= '> ' . str_replace("\n", "\n> ", $rewrap_body[$i]) . "\n";
+                    $body .= '> ' . str_replace("\n", "\n> ", rtrim($rewrap_body[$i])) . "\n";
                 }
                 }
                 unset($rewrap_body[$i]);
                 unset($rewrap_body[$i]);
             }
             }