Changeset 1366 in subversion


Ignore:
Timestamp:
May 8, 2008 5:07:04 AM (5 years ago)
Author:
alec
Message:
  • Corrected message headers decoding when charset isn't specified and improved support for native languages (#1485050, #1485048)
Location:
trunk/roundcubemail
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/CHANGELOG

    r1364 r1366  
    77- Optimized messages sorting on servers without sort capability (#1485049) 
    88- Option 'use_SQL_address_book' replaced by 'address_book_type' 
     9- Corrected message headers decoding when charset isn't specified and improved 
     10  support for native languages (#1485050, #1485048) 
    911 
    10122008/05/07 (davidke/richs) 
  • trunk/roundcubemail/program/include/rcube_imap.php

    r1363 r1366  
    23622362       
    23632363    // no encoding information, use fallback 
    2364     return rcube_charset_convert($input, !empty($fallback) ? $fallback : 'ISO-8859-1'); 
     2364    return rcube_charset_convert($input, !empty($fallback) ? $fallback : $this->default_charset); 
    23652365    } 
    23662366 
  • trunk/roundcubemail/program/steps/mail/func.inc

    r1356 r1366  
    233233    $out .= sprintf("<td class=\"icon\">%s</td>\n", $message_icon ? sprintf($image_tag, $skin_path, $message_icon, '') : ''); 
    234234 
     235    if (!empty($header->charset)) 
     236      $IMAP->set_charset($header->charset); 
     237   
    235238    // format each col 
    236239    foreach ($a_show_cols as $col) 
    237240      { 
    238241      if ($col=='from' || $col=='to') 
    239         $cont = Q(rcmail_address_string(rcube_imap::decode_mime_string($header->$col, $header->charset), 3, $attrib['addicon']), 'show'); 
     242        $cont = Q(rcmail_address_string($header->$col, 3, $attrib['addicon']), 'show'); 
    240243      else if ($col=='subject') 
    241244        { 
    242245        $action = $mbox==$CONFIG['drafts_mbox'] ? 'compose' : 'show'; 
    243246        $uid_param = $mbox==$CONFIG['drafts_mbox'] ? '_draf_uid' : '_uid'; 
    244         $cont = Q(rcube_imap::decode_mime_string($header->$col, $header->charset)); 
     247        $cont = Q($IMAP->decode_header($header->$col)); 
    245248        if (empty($cont)) $cont = Q(rcube_label('nosubject')); 
    246249        $cont = sprintf('<a href="%s" onclick="return rcube_event.cancel(event)">%s</a>', Q(rcmail_url($action, array($uid_param=>$header->uid, '_mbox'=>$mbox))), $cont); 
     
    322325      continue; 
    323326 
     327    if (!empty($header->charset)) 
     328      $IMAP->set_charset($header->charset); 
     329 
    324330    // format each col; similar as in rcmail_message_list() 
    325331    foreach ($a_show_cols as $col) 
    326332      { 
    327333      if ($col=='from' || $col=='to') 
    328         $cont = Q(rcmail_address_string(rcube_imap::decode_mime_string($header->$col, $header->charset), 3), 'show'); 
     334        $cont = Q(rcmail_address_string($header->$col, 3), 'show'); 
    329335      else if ($col=='subject') 
    330336        { 
    331337        $action = $mbox==$CONFIG['drafts_mbox'] ? 'compose' : 'show'; 
    332338        $uid_param = $mbox==$CONFIG['drafts_mbox'] ? '_draf_uid' : '_uid'; 
    333         $cont = Q(rcube_imap::decode_mime_string($header->$col, $header->charset)); 
     339        $cont = Q($IMAP->decode_header($header->$col)); 
    334340        if (!$cont) $cont = Q(rcube_label('nosubject')); 
    335341        $cont = sprintf('<a href="%s" onclick="return rcube_event.cancel(event)">%s</a>', Q(rcmail_url($action, array($uid_param=>$header->uid, '_mbox'=>$mbox))), $cont); 
     
    975981      $header_value = Q(rcmail_address_string($headers[$hkey], NULL, $attrib['addicon']), 'show'); 
    976982    else 
    977       $header_value = Q(rcube_imap::decode_mime_string($headers[$hkey], $headers['charset'])); 
     983      $header_value = Q($IMAP->decode_header($headers[$hkey])); 
    978984 
    979985    $out .= "\n<tr>\n"; 
     
    14671473  $message = array('UID' => $uid); 
    14681474  $message['headers'] = $IMAP->get_headers($message['UID']); 
    1469   $message['subject'] = rcube_imap::decode_mime_string($message['headers']->subject, $message['headers']->charset); 
     1475  $message['subject'] = $IMAP->decode_header($message['headers']->subject); 
    14701476   
    14711477  if ($message['headers']->mdn_to && !$message['headers']->mdn_sent) 
  • trunk/roundcubemail/program/steps/mail/show.inc

    r1344 r1366  
    6262    send_modified_header($_SESSION['login_time'], $etag, !$MESSAGE['headers']->seen); 
    6363 
    64   $MESSAGE['subject'] = rcube_imap::decode_mime_string($MESSAGE['headers']->subject, $MESSAGE['headers']->charset); 
     64  $MESSAGE['subject'] = $IMAP->decode_header($MESSAGE['headers']->subject); 
    6565  $OUTPUT->set_pagetitle($MESSAGE['subject']); 
    6666   
Note: See TracChangeset for help on using the changeset viewer.