diff options
Diffstat (limited to 'program/steps/mail')
-rw-r--r-- | program/steps/mail/addcontact.inc | 2 | ||||
-rw-r--r-- | program/steps/mail/compose.inc | 10 | ||||
-rw-r--r-- | program/steps/mail/func.inc | 17 | ||||
-rw-r--r-- | program/steps/mail/sendmail.inc | 6 |
4 files changed, 18 insertions, 17 deletions
diff --git a/program/steps/mail/addcontact.inc b/program/steps/mail/addcontact.inc index 613a63e39..21fbc2db2 100644 --- a/program/steps/mail/addcontact.inc +++ b/program/steps/mail/addcontact.inc @@ -46,7 +46,7 @@ if (!empty($_POST['_address']) && is_object($CONTACTS)) $OUTPUT->send(); } - $contact['email'] = idn_to_utf8($contact['email']); + $contact['email'] = rcube_idn_to_utf8($contact['email']); // use email address part for name if (empty($contact['name']) || $contact['name'] == $contact['email']) diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc index 45b95c937..eb42b2abe 100644 --- a/program/steps/mail/compose.inc +++ b/program/steps/mail/compose.inc @@ -321,7 +321,7 @@ function rcmail_compose_headers($attrib) if (empty($addr_part['mailto'])) continue; - $mailto = idn_to_utf8($addr_part['mailto']); + $mailto = rcube_idn_to_utf8($addr_part['mailto']); if (!in_array($mailto, $sa_recipients) && (!$MESSAGE->compose_from @@ -360,7 +360,7 @@ function rcmail_compose_headers($attrib) if (empty($addr_part['mailto'])) continue; - $mailto = idn_to_utf8($addr_part['mailto']); + $mailto = rcube_idn_to_utf8($addr_part['mailto']); if ($addr_part['name'] && $addr_part['mailto'] != $addr_part['name']) $string = format_email_recipient($mailto, $addr_part['name']); @@ -437,7 +437,7 @@ function rcmail_compose_header_from($attrib) // create SELECT element foreach ($user_identities as $sql_arr) { - $email = mb_strtolower(idn_to_utf8($sql_arr['email'])); + $email = mb_strtolower(rcube_idn_to_utf8($sql_arr['email'])); $identity_id = $sql_arr['identity_id']; $select_from->add(format_email_recipient($email, $sql_arr['name']), $identity_id); @@ -732,9 +732,9 @@ 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'))); + $from = array_pop($RCMAIL->imap->decode_address_list($MESSAGE->get_header('from'), 1, false)); $prefix = sprintf("On %s, %s wrote:", - $MESSAGE->headers->date, $from['name'] ? $from['name'] : idn_to_utf8($from['mailto'])); + $MESSAGE->headers->date, $from['name'] ? $from['name'] : rcube_idn_to_utf8($from['mailto'])); if (!$bodyIsHtml) { $body = preg_replace('/\r?\n/', "\n", $body); diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc index b62e8a86c..a4eb13175 100644 --- a/program/steps/mail/func.inc +++ b/program/steps/mail/func.inc @@ -56,9 +56,9 @@ if (!empty($_GET['_page'])) // set default sort col/order to session if (!isset($_SESSION['sort_col'])) - $_SESSION['sort_col'] = $CONFIG['message_sort_col']; + $_SESSION['sort_col'] = !empty($CONFIG['message_sort_col']) ? $CONFIG['message_sort_col'] : ''; if (!isset($_SESSION['sort_order'])) - $_SESSION['sort_order'] = $CONFIG['message_sort_order']; + $_SESSION['sort_order'] = strtoupper($CONFIG['message_sort_order']) == 'ASC' ? 'ASC' : 'DESC'; // set threads mode $a_threading = $RCMAIL->config->get('message_threading', array()); @@ -1194,15 +1194,16 @@ function rcmail_html4inline($body, $container_id, $body_id='', &$attributes=null */ function rcmail_alter_html_link($matches) { - global $EMAIL_ADDRESS_PATTERN; + global $RCMAIL, $EMAIL_ADDRESS_PATTERN; $tag = $matches[1]; $attrib = parse_attrib_string($matches[2]); $end = '>'; if ($tag == 'link' && preg_match('/^https?:\/\//i', $attrib['href'])) { - $attrib['href'] = "?_task=utils&_action=modcss&u=" . urlencode($attrib['href']) - . "&c=" . urlencode($GLOBALS['rcmail_html_container_id']); + $tempurl = 'tmp-' . md5($attrib['href']) . '.css'; + $_SESSION['modcssurls'][$tempurl] = $attrib['href']; + $attrib['href'] = $RCMAIL->url(array('task' => 'utils', 'action' => 'modcss', 'u' => $tempurl, 'c' => $GLOBALS['rcmail_html_container_id'])); $end = ' />'; } else if (preg_match('/^mailto:'.$EMAIL_ADDRESS_PATTERN.'(\?[^"\'>]+)?/i', $attrib['href'], $mailto)) { @@ -1250,10 +1251,10 @@ function rcmail_address_string($input, $max=null, $linked=false, $addicon=null) // IDNA ASCII to Unicode if ($name == $mailto) - $name = idn_to_utf8($name); + $name = rcube_idn_to_utf8($name); if ($string == $mailto) - $string = idn_to_utf8($string); - $mailto = idn_to_utf8($mailto); + $string = rcube_idn_to_utf8($string); + $mailto = rcube_idn_to_utf8($mailto); if ($PRINT_MODE) { $out .= sprintf('%s <%s>', Q($name), $mailto); diff --git a/program/steps/mail/sendmail.inc b/program/steps/mail/sendmail.inc index 770660c1d..ecc7f3369 100644 --- a/program/steps/mail/sendmail.inc +++ b/program/steps/mail/sendmail.inc @@ -153,11 +153,11 @@ function rcmail_email_input_format($mailto, $count=false, $check=true) $item = trim($item); // address in brackets without name (do nothing) if (preg_match('/^<\S+@\S+>$/', $item)) { - $item = idn_to_ascii($item); + $item = rcube_idn_to_ascii($item); $result[] = $item; // address without brackets and without name (add brackets) } else if (preg_match('/^\S+@\S+$/', $item)) { - $item = idn_to_ascii($item); + $item = rcube_idn_to_ascii($item); $result[] = '<'.$item.'>'; // address with name (handle name) } else if (preg_match('/\S+@\S+>*$/', $item, $matches)) { @@ -168,7 +168,7 @@ function rcmail_email_input_format($mailto, $count=false, $check=true) && preg_match('/[\(\)\<\>\\\.\[\]@,;:"]/', $name)) { $name = '"'.addcslashes($name, '"').'"'; } - $address = idn_to_ascii($address); + $address = rcube_idn_to_ascii($address); if (!preg_match('/^<\S+@\S+>$/', $address)) $address = '<'.$address.'>'; |