Forgot to use isset() instead of count() because I unset values in the array
authorfidian <fidian@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 2 Feb 2001 23:55:25 +0000 (23:55 +0000)
committerfidian <fidian@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 2 Feb 2001 23:55:25 +0000 (23:55 +0000)
when I am done with them (frees up memory).

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@1049 7612ce4b-ef26-0410-bec9-ea0150e637f0

src/compose.php

index 66cd551cd71261a8e81e7ecf335efcb7f7c57dd0..302cab44e2a522ffde92cdbbdbbeff7962255beb 100644 (file)
          } else {
             $body = "";
          }
          } else {
             $body = "";
          }
-         
+        
          if ($message->header->type1 == "html")
             $body = strip_tags($body);
 
          sqUnWordWrap($body);   
          $body_ary = explode("\n", $body);
          $i = count($body_ary) - 1;
          if ($message->header->type1 == "html")
             $body = strip_tags($body);
 
          sqUnWordWrap($body);   
          $body_ary = explode("\n", $body);
          $i = count($body_ary) - 1;
-         while (isset($body_ary[$i]) && ereg("^[>\\s]*$", $body_ary[$i])) {
+         while ($i >= 0 && ereg("^[>\\s]*$", $body_ary[$i])) {
             unset($body_ary[$i]);
             $i --;
          }
          $body = "";
             unset($body_ary[$i]);
             $i --;
          }
          $body = "";
-         for ($i=0; $i < count($body_ary); $i++) {
+         for ($i=0; isset($body_ary[$i]); $i++) {
             if (! $forward_id)
             {
                 if (ereg('^[\\s>]+', $body_ary[$i]))
             if (! $forward_id)
             {
                 if (ereg('^[\\s>]+', $body_ary[$i]))