From f01b15e4a7adbdc0adeb24bf837cc872c70bcb96 Mon Sep 17 00:00:00 2001 From: lkehresman Date: Thu, 9 Mar 2000 13:00:16 +0000 Subject: [PATCH] fixed a bug with email addresses not displaying right in message list git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@292 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/imap_general.php | 5 +++-- src/read_body.php | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/functions/imap_general.php b/functions/imap_general.php index 26d9107c..166d8765 100755 --- a/functions/imap_general.php +++ b/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, "<")); diff --git a/src/read_body.php b/src/read_body.php index 757a3d96..6cafd3fe 100644 --- a/src/read_body.php +++ b/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 "
"; echo "\n"; -- 2.25.1