summaryrefslogtreecommitdiff
path: root/program/steps/mail
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2010-09-30 08:30:46 +0000
committeralecpl <alec@alec.pl>2010-09-30 08:30:46 +0000
commit9f9664338f66a82e15c1ce9b79dc24430c593af4 (patch)
tree3531dace0b2f08c0280bac17a6f32f0e5734038f /program/steps/mail
parent1148c6e936c487c72740ba93ae430b42837e6999 (diff)
- Change reply prefix to display email address only if sender name doesn't exist (#1486550)
Diffstat (limited to 'program/steps/mail')
-rw-r--r--program/steps/mail/compose.inc19
1 files changed, 9 insertions, 10 deletions
diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc
index 5a66af141..b9594a09f 100644
--- a/program/steps/mail/compose.inc
+++ b/program/steps/mail/compose.inc
@@ -624,9 +624,14 @@ function rcmail_create_reply_body($body, $bodyIsHtml)
{
global $RCMAIL, $MESSAGE, $LINE_LENGTH;
+ // build reply prefix
+ $from = array_pop($RCMAIL->imap->decode_address_list($MESSAGE->get_header('from')));
+ $prefix = sprintf("On %s, %s wrote:",
+ $MESSAGE->headers->date, $from['name'] ? $from['name'] : idn_to_utf8($from['email']));
+
if (!$bodyIsHtml) {
$body = preg_replace('/\r?\n/', "\n", $body);
-
+
// try to remove the signature
if ($RCMAIL->config->get('strip_existing_sig', true)) {
$len = strlen($body);
@@ -644,13 +649,9 @@ function rcmail_create_reply_body($body, $bodyIsHtml)
// soft-wrap and quote message text
$body = rcmail_wrap_and_quote(rtrim($body, "\n"), $LINE_LENGTH);
- // add title line(s)
- $prefix = sprintf("On %s, %s wrote:\n",
- $MESSAGE->headers->date,
- $MESSAGE->get_header('from'));
-
+ $prefix .= "\n";
$suffix = '';
-
+
if ($RCMAIL->config->get('top_posting'))
$prefix = "\n\n\n" . $prefix;
}
@@ -663,9 +664,7 @@ function rcmail_create_reply_body($body, $bodyIsHtml)
$body = rcmail_wash_html($body, array('safe' => $MESSAGE->is_safe), $cid_map);
// build reply (quote content)
- $prefix = sprintf("<p>On %s, %s wrote:</p>\n",
- $MESSAGE->headers->date,
- htmlspecialchars(Q($MESSAGE->get_header('from'), 'replace'), ENT_COMPAT, $RCMAIL->output->get_charset()));
+ $prefix = '<p>' . Q($prefix) . "</p>\n";
$prefix .= '<blockquote>';
if ($RCMAIL->config->get('top_posting')) {