/**
* compose.php
*
- * Copyright (c) 1999-2001 The Squirrelmail Development Team
+ * Copyright (c) 1999-2002 The SquirrelMail Project Team
* Licensed under the GNU GPL. For full terms see the file COPYING.
*
* This code sends a mail.
$body = $bodyTop . $body;
} else if ($reply_id) {
$orig_from = decodeHeader($orig_header->from);
- $orig_from = trim(substr($orig_from,0,strpos($orig_from,'<')));
- $orig_from = str_replace('"','',$orig_from);
- $orig_from = str_replace("'",'',$orig_from);
$body = getReplyCitation($orig_from) . $body;
}
}
// This code is for attachments
- echo " <tr>\n";
- echo " <TD BGCOLOR=\"$color[0]\" VALIGN=MIDDLE ALIGN=RIGHT>\n";
+ echo " <TR>\n";
+ echo " <TD VALIGN=MIDDLE ALIGN=RIGHT>\n";
echo _("Attach:");
- echo " </td><td ALIGN=left BGCOLOR=\"$color[0]\">\n";
+ echo " </TD>\n";
+ echo " <TD VALIGN=MIDDLE ALIGN=LEFT>\n";
echo " <INPUT NAME=\"attachfile\" SIZE=48 TYPE=\"file\">\n";
echo " <input type=\"submit\" name=\"attach\"";
echo " value=\"" . _("Add") ."\">\n";
- echo " </td>\n";
- echo " </tr>\n";
+ echo " </TD>\n";
+ echo " </TR>\n";
if (count($attachments)) {
$hashed_attachment_dir = getHashedDir($username, $attachment_dir);
echo "<tr><td bgcolor=\"$color[0]\" align=right>\n";
return ('');
}
+ /* Decode the users name. */
+ $parpos = strpos($orig_from, '(');
+ if ($parpos === false) {
+ $orig_from = trim(substr($orig_from, 0, strpos($orig_from, '<')));
+ $orig_from = str_replace('"', '', $orig_from);
+ $orig_from = str_replace("'", '', $orig_from);
+ } else {
+ $end_parpos = strrpos($orig_from, ')');
+ $end_parpos -= ($end_parpos === false ? $end_parpos : $parpos + 1);
+ $orig_from = trim(substr($orig_from, $parpos + 1, $end_parpos));
+ }
+
+ /* Make sure our final value isn't an empty string. */
+ if ($orig_from == '') {
+ return ('');
+ }
+
/* Otherwise, try to select the desired citation style. */
switch ($reply_citation_style) {
case 'author_said':