Browse Source

- fixed some more HTML bugs
- fixed bug that threw message index into infinite loop
- changed compose.php to have ENCTYPE=multipart/form-data again

Luke Ehresman 25 years ago
parent
commit
049f7a3655
5 changed files with 21 additions and 13 deletions
  1. 7 3
      functions/mime.php
  2. 1 1
      functions/url_parser.php
  3. 2 2
      src/compose.php
  4. 11 5
      src/download.php
  5. 0 2
      src/read_body.php

+ 7 - 3
functions/mime.php

@@ -427,7 +427,7 @@
       // this if statement checks for the entity to show as the
       // this if statement checks for the entity to show as the
       // primary message. To add more of them, just put them in the
       // primary message. To add more of them, just put them in the
       // order that is their priority.
       // order that is their priority.
-      global $username, $key, $imapServerAddress, $imapPort;
+      global $startMessage, $username, $key, $imapServerAddress, $imapPort;
 
 
       $id = $message->header->id;
       $id = $message->header->id;
       $urlmailbox = urlencode($message->header->mailbox);
       $urlmailbox = urlencode($message->header->mailbox);
@@ -449,6 +449,7 @@
 
 
       /** Display the ATTACHMENTS: message if there's more than one part **/
       /** Display the ATTACHMENTS: message if there's more than one part **/
       if ($message->entities) {
       if ($message->entities) {
+         $body .= "</TD></TR></TABLE>";
          $body .= "<TABLE WIDTH=100% CELLSPACING=0 CELLPADDING=4 BORDER=0><TR><TD BGCOLOR=\"$color[0]\">";
          $body .= "<TABLE WIDTH=100% CELLSPACING=0 CELLPADDING=4 BORDER=0><TR><TD BGCOLOR=\"$color[0]\">";
          $body .= "<TT><B>ATTACHMENTS:</B></TT>";
          $body .= "<TT><B>ATTACHMENTS:</B></TT>";
          $body .= "</TD></TR><TR><TD BGCOLOR=\"$color[0]\">";
          $body .= "</TD></TR><TR><TD BGCOLOR=\"$color[0]\">";
@@ -456,6 +457,8 @@
 
 
          $body .= formatAttachments ($message, $ent_num, $message->header->mailbox, $id);
          $body .= formatAttachments ($message, $ent_num, $message->header->mailbox, $id);
          $body .= "</TD></TR></TABLE>";
          $body .= "</TD></TR></TABLE>";
+      } else {
+         $body .= "</TD></TR></TABLE>";
       }
       }
       return $body;
       return $body;
    }
    }
@@ -464,6 +467,7 @@
    // to where to download these attachments
    // to where to download these attachments
    function formatAttachments ($message, $ent_id, $mailbox, $id) {
    function formatAttachments ($message, $ent_id, $mailbox, $id) {
       global $where, $what;
       global $where, $what;
+      global $startMessage;
       if ($message) {
       if ($message) {
          if (!$message->entities) {
          if (!$message->entities) {
             $type0 = strtolower($message->header->type0);
             $type0 = strtolower($message->header->type0);
@@ -481,9 +485,9 @@
                $ent = urlencode($message->header->entity_id);
                $ent = urlencode($message->header->entity_id);
                if ($where && $what) {   
                if ($where && $what) {   
                   // from a search
                   // from a search
-                  $body .= "<TT>&nbsp;&nbsp;&nbsp;<A HREF=\"../src/download.php?where=".urlencode($where)."&what=".urlencode($what)."&passed_id=$id&mailbox=$urlMailbox&passed_ent_id=$ent\">" . $display_filename . "</A>&nbsp;&nbsp;(TYPE: $type0/$type1)";
+                  $body .= "<TT>&nbsp;&nbsp;&nbsp;<A HREF=\"../src/download.php?startMessage=$startMessage&where=".urlencode($where)."&what=".urlencode($what)."&passed_id=$id&mailbox=$urlMailbox&passed_ent_id=$ent\">" . $display_filename . "</A>&nbsp;&nbsp;(TYPE: $type0/$type1)";
                } else {   
                } else {   
-                  $body .= "<TT>&nbsp;&nbsp;&nbsp;<A HREF=\"../src/download.php?passed_id=$id&mailbox=$urlMailbox&passed_ent_id=$ent\">" . $display_filename . "</A>&nbsp;&nbsp;(TYPE: $type0/$type1)";
+                  $body .= "<TT>&nbsp;&nbsp;&nbsp;<A HREF=\"../src/download.php?startMessage=$startMessage&passed_id=$id&mailbox=$urlMailbox&passed_ent_id=$ent\">" . $display_filename . "</A>&nbsp;&nbsp;(TYPE: $type0/$type1)";
                }
                }
                if ($message->header->description)
                if ($message->header->description)
                   $body .= "&nbsp;&nbsp;<b>" . htmlspecialchars($message->header->description)."</b>";
                   $body .= "&nbsp;&nbsp;<b>" . htmlspecialchars($message->header->description)."</b>";

+ 1 - 1
functions/url_parser.php

@@ -35,7 +35,7 @@
       #Possible ways a URL could finish.
       #Possible ways a URL could finish.
 
 
       $poss_ends=array(" ", "\n", "\r", "<", ">", ".\r", ".\n", ".&nbsp;", "&nbsp;", ")", "(", 
       $poss_ends=array(" ", "\n", "\r", "<", ">", ".\r", ".\n", ".&nbsp;", "&nbsp;", ")", "(", 
-                       "&quot;", "&lt;", "&gt;", ".<");
+                       "&quot;", "&lt;", "&gt;", ".<", "]", "[", "{", "}", "--");
       $done=False;
       $done=False;
       while (!$done) {
       while (!$done) {
          #Look for when a URL starts
          #Look for when a URL starts

+ 2 - 2
src/compose.php

@@ -152,8 +152,8 @@
          echo "// --></SCRIPT>\n\n";
          echo "// --></SCRIPT>\n\n";
       }
       }
 
 
-      //echo "\n<FORM name=compose action=\"compose.php\" METHOD=POST ENCTYPE=\"multipart/form-data\">\n";
-      echo "\n<FORM name=compose action=\"compose.php\" METHOD=POST>\n";
+      echo "\n<FORM name=compose action=\"compose.php\" METHOD=POST ENCTYPE=\"multipart/form-data\">\n";
+      //echo "\n<FORM name=compose action=\"compose.php\" METHOD=POST>\n";
       if ($reply_id) {
       if ($reply_id) {
          echo "<input type=hidden name=reply_id value=$reply_id>\n";
          echo "<input type=hidden name=reply_id value=$reply_id>\n";
       }		 
       }		 

+ 11 - 5
src/download.php

@@ -26,9 +26,10 @@
 
 
    function viewText($color, $body, $id, $entid, $mailbox, $type1, $wrap_at) {
    function viewText($color, $body, $id, $entid, $mailbox, $type1, $wrap_at) {
       global $where, $what, $charset;
       global $where, $what, $charset;
+      global $startMessage;
       displayPageHeader($color, "None");
       displayPageHeader($color, "None");
 
 
-      echo "<BR><TABLE WIDTH=90% BORDER=0 CELLSPACING=0 CELLPADDING=2 ALIGN=CENTER><TR><TD BGCOLOR=\"$color[0]\">";
+      echo "<BR><TABLE WIDTH=100% BORDER=0 CELLSPACING=0 CELLPADDING=2 ALIGN=CENTER><TR><TD BGCOLOR=\"$color[0]\">";
       echo "<B><CENTER>";
       echo "<B><CENTER>";
       echo _("Viewing a text attachment") . " - ";
       echo _("Viewing a text attachment") . " - ";
       if ($where && $what) {
       if ($where && $what) {
@@ -37,12 +38,17 @@
       } else {   
       } else {   
          echo "<a href=\"read_body.php?mailbox=".urlencode($mailbox)."&passed_id=$id&startMessage=$startMessage&show_more=0\">". _("View message") . "</a>";
          echo "<a href=\"read_body.php?mailbox=".urlencode($mailbox)."&passed_id=$id&startMessage=$startMessage&show_more=0\">". _("View message") . "</a>";
       }   
       }   
-      echo "</CENTER></B>";
-      echo "</TD></TR><TR><TD BGCOLOR=\"$color[4]\">";
+
       $urlmailbox = urlencode($mailbox);
       $urlmailbox = urlencode($mailbox);
-      echo "<CENTER><A HREF=\"../src/download.php?absolute_dl=true&passed_id=$id&passed_ent_id=$entid&mailbox=$urlmailbox\">";
+      echo "</b></td><tr><tr><td><CENTER><A HREF=\"../src/download.php?absolute_dl=true&passed_id=$id&passed_ent_id=$entid&mailbox=$urlmailbox\">";
       echo _("Download this as a file");
       echo _("Download this as a file");
-      echo "</A></CENTER><BR><BR><TT>";
+      echo "</A></CENTER><BR>";
+      echo "</CENTER></B>";
+      echo "</TD></TR></TABLE>";
+
+      echo "<TABLE WIDTH=98% BORDER=0 CELLSPACING=0 CELLPADDING=2 ALIGN=CENTER><TR><TD BGCOLOR=\"$color[0]\">";
+      echo "<TR><TD BGCOLOR=\"$color[4]\"><TT>";
+
       if ($type1 == "html")
       if ($type1 == "html")
          echo $body;
          echo $body;
       else
       else

+ 0 - 2
src/read_body.php

@@ -337,8 +337,6 @@
 
 
    echo "$body";
    echo "$body";
 
 
-   echo "   </TD></TR>\n";
-   echo "</table>";
    echo "<TABLE COLS=1 CELLSPACING=0 WIDTH=100% BORDER=0 ALIGN=CENTER CELLPADDING=0>\n";
    echo "<TABLE COLS=1 CELLSPACING=0 WIDTH=100% BORDER=0 ALIGN=CENTER CELLPADDING=0>\n";
    echo "   <TR><TD BGCOLOR=\"$color[9]\">&nbsp;</TD></TR>";
    echo "   <TR><TD BGCOLOR=\"$color[9]\">&nbsp;</TD></TR>";
    echo "</TABLE>\n";
    echo "</TABLE>\n";