Browse Source

fixed a bug with email addresses not displaying right in message list

lkehresman 25 years ago
parent
commit
dd02fd59e7

+ 3 - 2
trunk/squirrelmail/functions/imap_general.php

@@ -184,7 +184,7 @@
          $string = substr($string, strpos($string, "<")+1);
          $string = substr($string, 0, strpos($string, ">"));
       }
-      return $string; 
+      return trim($string); 
    }
 
    
@@ -196,8 +196,9 @@
     **           becomes:   lkehresman@yahoo.com
     ******************************************************************************/
    function sqimap_find_displayable_name ($string) {
+      $string = " ".trim($string);
       if (strpos($string, "<") && strpos($string, ">")) {
-         if (strpos($string, "<") == 0) {
+         if (strpos($string, "<") == 1) {
             $string = sqimap_find_email($string);
          } else {
             $string = substr($string, 0, strpos($string, "<"));

+ 2 - 2
trunk/squirrelmail/src/read_body.php

@@ -88,8 +88,8 @@
    }
 
    /** make sure everything will display in HTML format **/
-   $from_name = decodeHeader($message["HEADER"]["FROM"]);
-   $subject = decodeHeader(stripslashes($message["HEADER"]["SUBJECT"]));
+   $from_name = htmlspecialchars(decodeHeader($message["HEADER"]["FROM"]));
+   $subject = htmlspecialchars(decodeHeader(stripslashes($message["HEADER"]["SUBJECT"])));
 
    echo "<BR>";
    echo "<TABLE COLS=1 CELLSPACING=0 WIDTH=98% BORDER=0 ALIGN=CENTER CELLPADDING=0>\n";