Browse Source

> Subject: Yahoo Mail Failure.
> From: "Chris Picciotto" <Chris@Picciotto.net>
> Date: Thu, February 14, 2002 5:20 pm

philippe_mingo 23 years ago
parent
commit
890d100e0a
2 changed files with 13 additions and 12 deletions
  1. 7 6
      functions/mime.php
  2. 6 6
      src/webmail.php

+ 7 - 6
functions/mime.php

@@ -632,7 +632,7 @@ function formatBody($imap_stream, $message, $color, $wrap_at) {
         } else {
         } else {
             translateText($body, $wrap_at, $body_message->header->charset);
             translateText($body, $wrap_at, $body_message->header->charset);
         }
         }
-        
+
         $body .= "<SMALL><CENTER><A HREF=\"../src/download.php?absolute_dl=true&passed_id=$id&passed_ent_id=$ent_num&mailbox=$urlmailbox&showHeaders=1\">". _("Download this as a file") ."</A></CENTER><BR></SMALL>";
         $body .= "<SMALL><CENTER><A HREF=\"../src/download.php?absolute_dl=true&passed_id=$id&passed_ent_id=$ent_num&mailbox=$urlmailbox&showHeaders=1\">". _("Download this as a file") ."</A></CENTER><BR></SMALL>";
 
 
         /** Display the ATTACHMENTS: message if there's more than one part **/
         /** Display the ATTACHMENTS: message if there's more than one part **/
@@ -827,7 +827,7 @@ return ($string);
  */
  */
 function encodeHeader ($string) {
 function encodeHeader ($string) {
     global $default_charset;
     global $default_charset;
-    
+
     // Encode only if the string contains 8-bit characters or =?
     // Encode only if the string contains 8-bit characters or =?
     $j = strlen( $string  );
     $j = strlen( $string  );
     $l = strstr($string, '=?');         // Must be encoded ?
     $l = strstr($string, '=?');         // Must be encoded ?
@@ -855,7 +855,7 @@ function encodeHeader ($string) {
              $ret .= $string{$i};
              $ret .= $string{$i};
         }
         }
     }
     }
-    
+
     if ( $l ) {
     if ( $l ) {
         $string = "=?$default_charset?Q?$ret?=";
         $string = "=?$default_charset?Q?$ret?=";
     }
     }
@@ -868,7 +868,7 @@ function encodeHeader ($string) {
 */
 */
 function MagicHTML( $body, $id ) {
 function MagicHTML( $body, $id ) {
 
 
-    global $message, $HTTP_SERVER_VARS, 
+    global $message, $HTTP_SERVER_VARS,
            $attachment_common_show_images;
            $attachment_common_show_images;
 
 
     $attachment_common_show_images =
     $attachment_common_show_images =
@@ -886,11 +886,12 @@ function MagicHTML( $body, $id ) {
             $pos = $i + 1;
             $pos = $i + 1;
             $tag = '';
             $tag = '';
             while ($body{$pos} == ' ' || $body{$pos} == "\t" ||
             while ($body{$pos} == ' ' || $body{$pos} == "\t" ||
-                   $body{$pos} == "\n") {
+                   $body{$pos} == "\n" ) {
                 $pos ++;
                 $pos ++;
             }
             }
             while (strlen($tag) < 4 && $body{$pos} != ' ' &&
             while (strlen($tag) < 4 && $body{$pos} != ' ' &&
-                   $body{$pos} != "\t" && $body{$pos} != "\n") {
+                   $body{$pos} != "\t" && $body{$pos} != "\n" &&
+                   $pos < $j ) {
                 $tag .= $body{$pos};
                 $tag .= $body{$pos};
                 $pos ++;
                 $pos ++;
             }
             }

+ 6 - 6
src/webmail.php

@@ -78,7 +78,7 @@ else {
  * we would like to use as little Javascript as possible.
  * we would like to use as little Javascript as possible.
  */
  */
 if (!isset($right_frame)) {
 if (!isset($right_frame)) {
-    $right_frame = "";
+    $right_frame = '';
 }
 }
 
 
 if ($right_frame == 'right_main.php') {
 if ($right_frame == 'right_main.php') {
@@ -96,14 +96,14 @@ if ($right_frame == 'right_main.php') {
 }
 }
 
 
 if ($location_of_bar == 'right') {
 if ($location_of_bar == 'right') {
-    echo "<FRAME SRC=\"$right_frame_url\" NORESIZE NAME=\"right\">";
-    echo '<FRAME SRC="left_main.php" NORESIZE NAME="left">';
+    echo "<FRAME SRC=\"$right_frame_url\" NORESIZE NAME=\"right\">" .
+         '<FRAME SRC="left_main.php" NORESIZE NAME="left">';
 }
 }
 else {
 else {
-    echo '<FRAME SRC="left_main.php" NORESIZE NAME="left">';
-    echo "<FRAME SRC=\"$right_frame_url\" NORESIZE NAME=\"right\">";
+    echo '<FRAME SRC="left_main.php" NORESIZE NAME="left">'.
+         "<FRAME SRC=\"$right_frame_url\" NORESIZE NAME=\"right\">";
 }
 }
 
 
 ?>
 ?>
 </FRAMESET>
 </FRAMESET>
-</HEAD></HTML>
+</HEAD></HTML>