Ticket #1484961: roundcubemail-1246-default-charset.patch

File roundcubemail-1246-default-charset.patch, 1.5 KB (added by joungkyun, 2 years ago)

fixed case of ignored default_charset

  • program/include/rcube_imap.inc

    diff -ruNp roundcubemail-1246.org/program/include/rcube_imap.inc roundcubemail-1246/program/include/rcube_imap.inc
    old new  
    10161016   */ 
    10171017  function &get_structure($uid) 
    10181018    { 
     1019    global $CONFIG; 
     1020 
    10191021    $cache_key = $this->mailbox.'.msg'; 
    10201022    $headers = &$this->get_cached_message($cache_key, $uid, true); 
    10211023 
     
    10281030      return FALSE; 
    10291031 
    10301032    $structure_str = iil_C_FetchStructureString($this->conn, $this->mailbox, $msg_id);  
     1033    if ( preg_match ('/US-ASCII/', $structure_str) ) { 
     1034      if ( $CONFIG['default_charset'] ) 
     1035        $structure_str = preg_replace ('/US-ASCII/', $CONFIG['default_charset'], $structure_str); 
     1036    } 
    10311037    $structure = iml_GetRawStructureArray($structure_str); 
    10321038    $struct = false; 
    10331039 
     
    23342340   */ 
    23352341  function decode_mime_string($input, $fallback=null) 
    23362342    { 
     2343    global $CONFIG; 
    23372344    $out = ''; 
    23382345 
    23392346    $pos = strpos($input, '=?'); 
     
    23592366      } 
    23602367       
    23612368    // no encoding information, use fallback 
    2362     return rcube_charset_convert($input, !empty($fallback) ? $fallback : 'ISO-8859-1'); 
     2369    $def_charset = $CONFIG['default_charset'] ? $CONFIG['default_charset'] : 'ISO-8859-1'; 
     2370    return rcube_charset_convert($input, !empty($fallback) ? $fallback : $def_charset); 
    23632371    } 
    23642372 
    23652373