Changeset 0816567 in github


Ignore:
Timestamp:
Aug 27, 2009 4:08:27 AM (4 years ago)
Author:
thomascube <thomas@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
Children:
6c2d7ed
Parents:
e0896df
Message:

Only allow images as 'inline' parts; list other parts as attachments if they have a valid mime type

File:
1 edited

Legend:

Unmodified
Added
Removed
  • program/include/rcube_message.php

    r330ef6c r0816567  
    393393          // part belongs to a related message and is linked 
    394394          if ($message_ctype_secondary == 'related' 
    395               && ($mail_part->headers['content-id'] || $mail_part->headers['content-location'])) { 
     395              && preg_match('!^image/!', $mail_part->mimetype) 
     396              && ($mail_part->headers['content-id'] || $mail_part->headers['content-location'])) { 
    396397            if ($mail_part->headers['content-id']) 
    397398              $mail_part->content_id = preg_replace(array('/^</', '/>$/'), '', $mail_part->headers['content-id']); 
    398399            if ($mail_part->headers['content-location']) 
    399400              $mail_part->content_location = $mail_part->headers['content-base'] . $mail_part->headers['content-location']; 
    400      
     401               
    401402            $this->inline_parts[] = $mail_part; 
    402403          } 
    403404          // is a regular attachment 
    404           else { 
     405          else if (preg_match('!^[a-z]+/[a-z0-9-.]+$!i', $mail_part->mimetype)) { 
    405406            if (!$mail_part->filename) 
    406407              $mail_part->filename = 'Part '.$mail_part->mime_id; 
Note: See TracChangeset for help on using the changeset viewer.