From f1654a33b271f80422729f72d58695130724cb98 Mon Sep 17 00:00:00 2001 From: alecpl Date: Sat, 29 Oct 2011 13:45:25 +0000 Subject: - Applied fixes from trunk up to r5371 --- CHANGELOG | 2 ++ program/include/rcube_message.php | 1 - program/steps/mail/func.inc | 9 ++------- program/steps/mail/sendmail.inc | 13 ++++++------- 4 files changed, 10 insertions(+), 15 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 34cf77cb8..fb3bb4e65 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,8 @@ CHANGELOG Roundcube Webmail =========================== +- Fix IDN address validation issue (#1488137) +- Fix JS error when dst_active checkbox doesn't exist (#1488133) - Autocomplete LDAP records when adding contacts from mail (#1488073) - Plugin API: added 'ready' hook (#1488063) - Ignore DSN request when it isn't supported by SMTP server (#1487800) diff --git a/program/include/rcube_message.php b/program/include/rcube_message.php index e0c49f80c..0ecd86c4c 100644 --- a/program/include/rcube_message.php +++ b/program/include/rcube_message.php @@ -48,7 +48,6 @@ class rcube_message public $uid = null; public $headers; - public $structure; public $parts = array(); public $mime_parts = array(); public $attachments = array(); diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc index f9352a3df..69724c554 100644 --- a/program/steps/mail/func.inc +++ b/program/steps/mail/func.inc @@ -1037,14 +1037,8 @@ function rcmail_message_body($attrib) rcmail_plain_body(Q($MESSAGE->body, 'strict', false)))); } - $ctype_primary = strtolower($MESSAGE->structure->ctype_primary); - $ctype_secondary = strtolower($MESSAGE->structure->ctype_secondary); - // list images after mail body - if ($CONFIG['inline_images'] - && $ctype_primary == 'multipart' - && !empty($MESSAGE->attachments)) - { + if ($CONFIG['inline_images'] && !empty($MESSAGE->attachments)) { foreach ($MESSAGE->attachments as $attach_prop) { // Content-Type: image/*... if (preg_match('/^image\//i', $attach_prop->mimetype) || @@ -1427,6 +1421,7 @@ function rcmail_compose_cleanup($id) $rcmail = rcmail::get_instance(); $rcmail->plugins->exec_hook('attachments_cleanup', array('group' => $id)); $rcmail->session->remove('compose_data_'.$id); + $rcmail->session->remove('compose'); } diff --git a/program/steps/mail/sendmail.inc b/program/steps/mail/sendmail.inc index deddb45e8..5022444a7 100644 --- a/program/steps/mail/sendmail.inc +++ b/program/steps/mail/sendmail.inc @@ -159,14 +159,14 @@ function rcmail_email_input_format($mailto, $count=false, $check=true) $item = trim($item); // address in brackets without name (do nothing) if (preg_match('/^<'.$email_regexp.'>$/', $item)) { - $item = rcube_idn_to_ascii($item); - $result[] = $item; + $item = rcube_idn_to_ascii(trim($item, '<>')); + $result[] = '<' . $item . '>'; // address without brackets and without name (add brackets) } else if (preg_match('/^'.$email_regexp.'$/', $item)) { $item = rcube_idn_to_ascii($item); - $result[] = '<'.$item.'>'; + $result[] = '<' . $item . '>'; // address with name (handle name) - } else if (preg_match('/'.$email_regexp.'>*$/', $item, $matches)) { + } else if (preg_match('/<*'.$email_regexp.'>*$/', $item, $matches)) { $address = $matches[0]; $name = str_replace($address, '', $item); $name = trim($name); @@ -174,9 +174,8 @@ function rcmail_email_input_format($mailto, $count=false, $check=true) && preg_match('/[\(\)\<\>\\\.\[\]@,;:"]/', $name)) { $name = '"'.addcslashes($name, '"').'"'; } - $address = rcube_idn_to_ascii($address); - if (!preg_match('/^<'.$email_regexp.'>$/', $address)) - $address = '<'.$address.'>'; + $address = rcube_idn_to_ascii(trim($address, '<>')); + $address = '<' . $address . '>'; $result[] = $name.' '.$address; $item = $address; -- cgit v1.2.3