runs message through sqWordWrap before putting it in compose area on reply
authorlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 12 Oct 2000 15:30:39 +0000 (15:30 +0000)
committerlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 12 Oct 2000 15:30:39 +0000 (15:30 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@793 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/strings.php
src/compose.php

index 82d30580926e4f7a74d427f13a1e2c089e3fa3bf..fa1d84f90ea02916d803a9203befb07fb7ae23be 100644 (file)
@@ -51,6 +51,7 @@
    function sqWordWrap(&$line, $wrap) {
       preg_match("/^([\s>]*)([^\s>].*)$/", $line, $regs);
       $beginning_spaces = $regs[1];
+      $regs[2] .= "\n"; 
       $words = explode(" ", $regs[2]);
 
       $i = 0;
index bcc27970953e93370216ac6e753cd33ff8c02740..48e7087aa43571262ad553cbc391d465abb58bc0 100644 (file)
@@ -41,7 +41,7 @@
    // This function is used when not sending or adding attachments
    function newMail () {
       global $forward_id, $imapConnection, $msg, $ent_num, $body_ary, $body,
-         $reply_id, $send_to, $send_to_cc, $mailbox, $send_to_bcc;
+         $reply_id, $send_to, $send_to_cc, $mailbox, $send_to_bcc, $editor_size;
 
       $send_to = sqStripSlashes(decodeHeader($send_to));
       $send_to_cc = sqStripSlashes(decodeHeader($send_to_cc));
          if ($message->header->type1 == "html")
             $body = strip_tags($body);
             
+         $body_ary = explode("\n", $body);
+         $body = "";
+         for ($i=0; $i < count($body_ary); $i++) {
+            sqWordWrap($body_ary[$i], $editor_size - 1);
+            $body .= $body_ary[$i];
+         }
+         $body_ary = array();
          $body_ary = explode("\n", $body);
          $body = "";
          for ($i=0; $i < count($body_ary); $i++) {
             else
                $body = "$body> $tmp\n";
          }
+
          sqimap_mailbox_close($imapConnection);
          return $body;   
       }