Changeset c9ca6ad in github


Ignore:
Timestamp:
Oct 24, 2008 8:01:45 PM (5 years ago)
Author:
svncommit <devs@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
Children:
072fdef
Parents:
1971ddc
Message:

added obscure ASCII encoding aliases, added more error checking to RFC2822 date parsing

Files:
6 edited

Legend:

Unmodified
Added
Removed
  • index.php

    r835ae851 rc9ca6ad  
    5050} 
    5151 
    52  
    5352// check if config files had errors 
    5453if ($err_str = $RCMAIL->config->get_error()) { 
     
    6665    'message' => $err_str), FALSE, TRUE); 
    6766} 
    68  
    6967 
    7068// error steps 
  • program/include/main.inc

    r407dcf9 rc9ca6ad  
    189189     
    190190  $aliases = array( 
    191     'US-ASCII'       => 'ISO-8859-1', 
    192     'UNKNOWN-8BIT'   => 'ISO-8859-15', 
    193     'X-UNKNOWN'      => 'ISO-8859-15', 
    194     'X-USER-DEFINED' => 'ISO-8859-15', 
    195     'ISO-8859-8-I'   => 'ISO-8859-8', 
    196     'KS_C_5601-1987' => 'EUC-KR', 
     191    'US-ASCII'         => 'ISO-8859-1', 
     192    'ANSI_X3.110-1983' => 'ISO-8859-1', 
     193    'ANSI_X3.4-1968'   => 'ISO-8859-1', 
     194    'UNKNOWN-8BIT'     => 'ISO-8859-15', 
     195    'X-UNKNOWN'        => 'ISO-8859-15', 
     196    'X-USER-DEFINED'   => 'ISO-8859-15', 
     197    'ISO-8859-8-I'     => 'ISO-8859-8', 
     198    'KS_C_5601-1987'   => 'EUC-KR', 
    197199  ); 
    198200 
     
    685687  else if (!empty($date)) 
    686688    { 
    687     while (($ts = @strtotime($date))===false) 
     689    // if date parsing fails, we have a date in non-rfc format. 
     690    // remove token from the end and try again 
     691    while ((($ts = @strtotime($date))===false) || ($ts < 0)) 
    688692      { 
    689         // if we have a date in non-rfc format 
    690         // remove token from the end and try again 
    691693        $d = explode(' ', $date); 
    692694        array_pop($d); 
     
    826828                 date("d-M-Y H:i:s O", mktime()), 
    827829                 $line); 
    828                   
     830 
    829831  if ($CONFIG['log_driver'] == 'syslog') { 
    830832    if ($name == 'errors') 
     
    837839    if (empty($CONFIG['log_dir'])) 
    838840      $CONFIG['log_dir'] = INSTALL_PATH.'logs'; 
    839        
     841 
    840842    // try to open specific log file for writing 
    841843    if ($fp = @fopen($CONFIG['log_dir'].'/'.$name, 'a')) { 
    842844      fwrite($fp, $log_entry); 
     845      fflush($fp); 
    843846      fclose($fp); 
    844847    } 
  • program/include/rcube_imap.php

    r28db73f rc9ca6ad  
    10261026 
    10271027    // return cached message structure 
    1028     if (is_object($headers) && is_object($headers->structure)) 
     1028    if (is_object($headers) && is_object($headers->structure)) { 
    10291029      return $headers->structure; 
    1030      
     1030    } 
     1031 
    10311032    // resolve message sequence number 
    1032     if (!($msg_id = $this->_uid2id($uid))) 
     1033    if (!($msg_id = $this->_uid2id($uid))) { 
    10331034      return FALSE; 
    1034  
    1035     $structure_str = iil_C_FetchStructureString($this->conn, $this->mailbox, $msg_id);  
     1035    } 
     1036 
     1037    $structure_str = iil_C_FetchStructureString($this->conn, $this->mailbox, $msg_id); 
    10361038    $structure = iml_GetRawStructureArray($structure_str); 
    10371039    $struct = false; 
  • program/include/rcube_message.php

    rae579ce rc9ca6ad  
    6464      'get_url' => rcmail_url('get', array('_mbox' => $this->imap->get_mailbox_name(), '_uid' => $uid)) 
    6565    ); 
    66      
     66 
    6767    if ($this->structure = $this->imap->get_structure($uid)) { 
    6868      $this->get_mime_numbers($this->structure); 
  • program/lib/Mail/mime.php

    rffae15e5 rc9ca6ad  
    10691069                    $hdr_value = $quotePrefix . $hdr_value . $quoteSuffix; 
    10701070                     
    1071  
    10721071                    $hdr_value_out = $hdr_value; 
    10731072                    $realMax = $maxLength1stLine + strlen($prefix . $suffix); 
  • program/steps/mail/show.inc

    ra887925 rc9ca6ad  
    2525if ($_GET['_uid']) { 
    2626  $MESSAGE = new rcube_message(get_input_value('_uid', RCUBE_INPUT_GET)); 
    27    
     27 
    2828  // set message charset as default 
    2929  if (!empty($MESSAGE->headers->charset)) 
     
    218218  $OUTPUT->send('printmessage'); 
    219219else if ($RCMAIL->action=='preview' && $OUTPUT->template_exists('messagepreview')) 
    220     $OUTPUT->send('messagepreview'); 
     220  $OUTPUT->send('messagepreview'); 
    221221else 
    222222  $OUTPUT->send('message'); 
Note: See TracChangeset for help on using the changeset viewer.