summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2014-06-13 15:05:12 +0200
committerAleksander Machniak <alec@alec.pl>2014-06-13 15:05:57 +0200
commit4162430a43d157802110ccfacf536a2036e0126f (patch)
tree74c86f0779a41886fa235d802316bb04e51d038d
parentf105dbb7691dd2ae919486a3b82b98be494e94be (diff)
Fix malformed recipient name when composing a message by clicking on mailto link (#1489942)
-rw-r--r--CHANGELOG1
-rw-r--r--program/steps/mail/compose.inc16
2 files changed, 11 insertions, 6 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 9562e9b4a..9dad7d773 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -13,6 +13,7 @@ CHANGELOG Roundcube Webmail
- Fix broken normalize_string(), add support for ISO-8859-2 (#1489918)
- Support csv contacts import in German localization (#1489920)
- Fix so message list and counters are updated when a message is opened in new window (#1489919)
+- Fix malformed recipient name when composing a message by clicking on mailto link (#1489942)
RELEASE 1.0.1
-------------
diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc
index ec7c9fa44..1414d903e 100644
--- a/program/steps/mail/compose.inc
+++ b/program/steps/mail/compose.inc
@@ -273,6 +273,7 @@ $from_email = @mb_strtolower($MESSAGE->compose['from_email']);
foreach ($parts as $header) {
$fvalue = '';
$decode_header = true;
+ $charset = $MESSAGE->headers->charset;
// we have a set of recipients stored is session
if ($header == 'to' && ($mailto_id = $COMPOSE['param']['mailto'])
@@ -280,16 +281,19 @@ foreach ($parts as $header) {
) {
$fvalue = urldecode($_SESSION['mailto'][$mailto_id]);
$decode_header = false;
+ $charset = $RCMAIL->output->charset;
// make session to not grow up too much
unset($_SESSION['mailto'][$mailto_id]);
$COMPOSE['param']['to'] = $fvalue;
}
else if (!empty($_POST['_'.$header])) {
- $fvalue = rcube_utils::get_input_value('_'.$header, rcube_utils::INPUT_POST, TRUE);
+ $fvalue = rcube_utils::get_input_value('_'.$header, rcube_utils::INPUT_POST, TRUE);
+ $charset = $RCMAIL->output->charset;
}
else if (!empty($COMPOSE['param'][$header])) {
- $fvalue = $COMPOSE['param'][$header];
+ $fvalue = $COMPOSE['param'][$header];
+ $charset = $RCMAIL->output->charset;
}
else if ($compose_mode == RCUBE_COMPOSE_REPLY) {
// get recipent address(es) out of the message headers
@@ -330,9 +334,9 @@ foreach ($parts as $header) {
// When To: and Reply-To: are the same we add From: address to the list (#1489037)
if ($v = $MESSAGE->headers->from) {
- $from = rcube_mime::decode_address_list($v, null, false, $MESSAGE->headers->charset, true);
- $to = rcube_mime::decode_address_list($MESSAGE->headers->to, null, false, $MESSAGE->headers->charset, true);
- $replyto = rcube_mime::decode_address_list($MESSAGE->headers->replyto, null, false, $MESSAGE->headers->charset, true);
+ $from = rcube_mime::decode_address_list($v, null, false, $charset, true);
+ $to = rcube_mime::decode_address_list($MESSAGE->headers->to, null, false, $charset, true);
+ $replyto = rcube_mime::decode_address_list($MESSAGE->headers->replyto, null, false, $charset, true);
if (count($replyto) && !count(array_diff($to, $replyto)) && count(array_diff($from, $to))) {
$fvalue .= (!empty($fvalue) ? $separator : '') . $v;
@@ -358,7 +362,7 @@ foreach ($parts as $header) {
// split recipients and put them back together in a unique way
if (!empty($fvalue) && in_array($header, array('to', 'cc', 'bcc'))) {
- $to_addresses = rcube_mime::decode_address_list($fvalue, null, $decode_header, $MESSAGE->headers->charset);
+ $to_addresses = rcube_mime::decode_address_list($fvalue, null, $decode_header, $charset);
$fvalue = array();
foreach ($to_addresses as $addr_part) {