Sometimes hitting Reply made the server practically die. This patch seems
[squirrelmail.git] / src / compose.php
index 39d3d33bb7a97cf479966ee0ab470204666bda94..f31aff053cfc5356dc655ed4050fef9816942f7e 100644 (file)
          
          sqUnWordWrap($body);   
          $body_ary = explode("\n", $body);
-         while (ereg("^[>\s]*$", $body_ary[count($body_ary) - 1])) {
-            unset($body_ary[count($body_ary) - 1]);
+         $i = count($body_ary) - 1;
+         while (isset($body_ary[$i]) && ereg("^[>\s]*$", $body_ary[$i])) {
+            unset($body_ary[$i]);
+            $i --;
          }
          $body = "";
          for ($i=0; $i < count($body_ary); $i++) {