- fixed some more HTML bugs
authorlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 2 Aug 2000 12:51:17 +0000 (12:51 +0000)
committerlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 2 Aug 2000 12:51:17 +0000 (12:51 +0000)
- fixed bug that threw message index into infinite loop
- changed compose.php to have ENCTYPE=multipart/form-data again

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

functions/mime.php
functions/url_parser.php
src/compose.php
src/download.php
src/read_body.php

index e864b7b..357aeca 100644 (file)
       // this if statement checks for the entity to show as the
       // primary message. To add more of them, just put them in the
       // order that is their priority.
-      global $username, $key, $imapServerAddress, $imapPort;
+      global $startMessage, $username, $key, $imapServerAddress, $imapPort;
 
       $id = $message->header->id;
       $urlmailbox = urlencode($message->header->mailbox);
 
       /** Display the ATTACHMENTS: message if there's more than one part **/
       if ($message->entities) {
+         $body .= "</TD></TR></TABLE>";
          $body .= "<TABLE WIDTH=100% CELLSPACING=0 CELLPADDING=4 BORDER=0><TR><TD BGCOLOR=\"$color[0]\">";
          $body .= "<TT><B>ATTACHMENTS:</B></TT>";
          $body .= "</TD></TR><TR><TD BGCOLOR=\"$color[0]\">";
 
          $body .= formatAttachments ($message, $ent_num, $message->header->mailbox, $id);
          $body .= "</TD></TR></TABLE>";
+      } else {
+         $body .= "</TD></TR></TABLE>";
       }
       return $body;
    }
    // to where to download these attachments
    function formatAttachments ($message, $ent_id, $mailbox, $id) {
       global $where, $what;
+      global $startMessage;
       if ($message) {
          if (!$message->entities) {
             $type0 = strtolower($message->header->type0);
                $ent = urlencode($message->header->entity_id);
                if ($where && $what) {   
                   // 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 {   
-                  $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)
                   $body .= "&nbsp;&nbsp;<b>" . htmlspecialchars($message->header->description)."</b>";
index 05aca96..9d44543 100644 (file)
@@ -35,7 +35,7 @@
       #Possible ways a URL could finish.
 
       $poss_ends=array(" ", "\n", "\r", "<", ">", ".\r", ".\n", ".&nbsp;", "&nbsp;", ")", "(", 
-                       "&quot;", "&lt;", "&gt;", ".<");
+                       "&quot;", "&lt;", "&gt;", ".<", "]", "[", "{", "}", "--");
       $done=False;
       while (!$done) {
          #Look for when a URL starts
index 1fc27a8..3936710 100644 (file)
          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) {
          echo "<input type=hidden name=reply_id value=$reply_id>\n";
       }                 
index bb7adb3..7c92975 100644 (file)
 
    function viewText($color, $body, $id, $entid, $mailbox, $type1, $wrap_at) {
       global $where, $what, $charset;
+      global $startMessage;
       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 _("Viewing a text attachment") . " - ";
       if ($where && $what) {
       } else {   
          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);
-      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 "</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")
          echo $body;
       else
index 197523e..740dc71 100644 (file)
 
    echo "$body";
 
-   echo "   </TD></TR>\n";
-   echo "</table>";
    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 "</TABLE>\n";