From cf8758c7d4f790421cdd79b6765f2b56766c0566 Mon Sep 17 00:00:00 2001 From: pallo Date: Wed, 5 Jul 2000 08:32:10 +0000 Subject: [PATCH] Applied patch from Toby Cabot to fix a small bug in address handling. Added htmlspecialchars() around variables in form output. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@588 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/strings.php | 1 + src/compose.php | 43 +++++++++++++++++++++---------------------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/functions/strings.php b/functions/strings.php index 84663b53..0cb53d5d 100644 --- a/functions/strings.php +++ b/functions/strings.php @@ -87,6 +87,7 @@ return; } $text = str_replace(" ", "", $text); + $text = ereg_replace( '"[^"]*"', "", $text); $text = str_replace(",", ";", $text); $array = explode(";", $text); for ($i = 0; $i < count ($array); $i++) { diff --git a/src/compose.php b/src/compose.php index 962d6730..9e894364 100644 --- a/src/compose.php +++ b/src/compose.php @@ -76,7 +76,7 @@ $send_to = sqimap_find_email($send_to); } - $send_to = ereg_replace("\"", "", $send_to); +// $send_to = ereg_replace("\"", "", $send_to); $send_to = stripslashes($send_to); /** This formats a CC string if they hit "reply all" **/ @@ -132,37 +132,30 @@ if ($reply_id) { echo "\n"; } - echo "\n"; + printf("\n", htmlspecialchars($mailbox)); echo "\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; @@ -175,7 +168,8 @@ $reply_subj = trim($reply_subj); if (substr(strtolower($reply_subj), 0, 3) != "re:") $reply_subj = "Re: $reply_subj"; - echo " "; + printf(" ", + htmlspecialchars($reply_subj)); } else if ($forward_subj) { $forward_subj = str_replace("\"", "'", $forward_subj); $forward_subj = stripslashes($forward_subj); @@ -184,9 +178,11 @@ (substr(strtolower($forward_subj), 0, 5) != "[fwd:") && (substr(strtolower($forward_subj), 0, 6) != "[ fwd:")) $forward_subj = "[Fwd: $forward_subj]"; - echo " "; + printf(" ", + htmlspecialchars($forward_subj)); } else { - echo " "; + printf(" ", + htmlspecialchars($subject)); } echo "\n\n"; @@ -207,10 +203,13 @@ echo " \n"; echo " \n"; echo " \n"; echo "
\n"; echo _("To:"); echo " \n"; - if ($send_to) - echo "
\n"; - else - echo "
\n"; + printf("
\n", + htmlspecialchars($send_to)); echo "
\n"; echo _("CC:"); echo " \n"; - if ($send_to_cc) - echo "
\n"; - else - echo "
\n"; + printf("
\n", + htmlspecialchars($send_to_cc)); echo "
\n"; echo _("BCC:"); echo " \n"; - if ($send_to_bcc) - echo "
\n"; - else - echo "
"; - + printf("
\n", + htmlspecialchars($send_to_bcc)); echo "
\n"; - if ($use_signature == true && $newmail == true) - echo "   
"; - else - echo "   
\n"; + echo "   
\n"; echo "