Changeset 3efc746 in github


Ignore:
Timestamp:
Jul 9, 2012 6:19:38 AM (10 months ago)
Author:
Aleksander Machniak <alec@…>
Children:
2b21b97
Parents:
98d0960
Message:
  • Don't add attachments content into reply/forward/draft message body (#1488557)
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • CHANGELOG

    r7794ae1 r3efc746  
    22=========================== 
    33 
     4- Don't add attachments content into reply/forward/draft message body (#1488557) 
    45- Fix 'no connection' errors on page unloads (#1488547) 
    56- Plugin API: Add 'unauthenticated' hook (#1488138) 
  • program/include/rcube_message.php

    r041c93c r3efc746  
    278278 
    279279    /** 
     280     * Checks if part of the message is an attachment (or part of it) 
     281     * 
     282     * @param rcube_message_part $part Message part 
     283     * 
     284     * @return bool True if the part is an attachment part 
     285     */ 
     286    public function is_attachment($part) 
     287    { 
     288        foreach ($this->attachments as $att_part) { 
     289            if ($att_part->mime_id == $part->mime_id) { 
     290                return true; 
     291            } 
     292 
     293            // check if the part is a subpart of another attachment part (message/rfc822) 
     294            if ($att_part->mimetype == 'message/rfc822') { 
     295                if (in_array($part, (array)$att_part->parts)) { 
     296                    return true; 
     297                } 
     298            } 
     299        } 
     300 
     301        return false; 
     302    } 
     303 
     304 
     305    /** 
    280306     * Read the message structure returend by the IMAP server 
    281307     * and build flat lists of content parts and attachments 
  • program/steps/mail/compose.inc

    rae6d2de r3efc746  
    630630    if (!empty($MESSAGE->parts)) { 
    631631      foreach ($MESSAGE->parts as $part) { 
    632         if ($part->type != 'content' || !$part->size) { 
     632        // skip no-content and attachment parts (#1488557) 
     633        if ($part->type != 'content' || !$part->size || $MESSAGE->is_attachment($part)) { 
    633634          continue; 
    634635        } 
Note: See TracChangeset for help on using the changeset viewer.