Browse Source

Forgot to use isset() instead of count() because I unset values in the array
when I am done with them (frees up memory).

Tyler Akins 24 năm trước cách đây
mục cha
commit
aac6086a3d
1 tập tin đã thay đổi với 3 bổ sung3 xóa
  1. 3 3
      src/compose.php

+ 3 - 3
src/compose.php

@@ -73,19 +73,19 @@
          } else {
             $body = "";
          }
-         
+	 
          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 = "";
-         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]))