Changeset 189 in subversion


Ignore:
Timestamp:
Apr 6, 2006 1:35:42 PM (7 years ago)
Author:
vengadrew
Message:

Corrected issue forwarding attachments without disposition headers

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/program/steps/mail/compose.inc

    r180 r189  
    397397    foreach ($FORWARD_MESSAGE['parts'] as $part) 
    398398      { 
    399       if ($part->disposition != 'attachment') 
    400         continue; 
    401  
    402       $tmp_path = tempnam($temp_dir, 'rcmAttmnt'); 
    403       if ($fp = fopen($tmp_path, 'w')) 
    404         { 
    405         fwrite($fp, $IMAP->mime_decode($part->body, $part->headers['content-transfer-encoding'])); 
    406         fclose($fp); 
    407  
    408         $_SESSION['compose']['attachments'][] = array('name' => $part->d_parameters['filename'], 
    409                                                       'mimetype' => $part->ctype_primary . '/' . $part->ctype_secondary, 
    410                                                       'path' => $tmp_path); 
    411         } 
     399      if ($part->disposition=='attachment' || $part->disposition=='inline' || $part->headers['content-id'] || 
     400               (empty($part->disposition) && ($part->d_parameters['filename'] || $part->ctype_parameters['name']))) 
     401        { 
     402        $tmp_path = tempnam($temp_dir, 'rcmAttmnt'); 
     403        if ($fp = fopen($tmp_path, 'w')) 
     404          { 
     405          fwrite($fp, $IMAP->mime_decode($part->body, $part->headers['content-transfer-encoding'])); 
     406          fclose($fp); 
     407 
     408          if ($part->d_parameters['filename']) 
     409            $_SESSION['compose']['attachments'][] = array('name' => $part->d_parameters['filename'], 
     410                                                          'mimetype' => $part->ctype_primary . '/' . $part->ctype_secondary, 
     411                                                          'path' => $tmp_path); 
     412                                    
     413          else if ($part->ctype_parameters['name']) 
     414            $_SESSION['compose']['attachments'][] = array('name' => $part->ctype_parameters['name'], 
     415                                                          'mimetype' => $part->ctype_primary . '/' . $part->ctype_secondary, 
     416                                                          'path' => $tmp_path); 
     417          } 
     418        } 
    412419      } 
    413420 
Note: See TracChangeset for help on using the changeset viewer.