- Fix content-type name regexp according to RFC4288.4.2

release-0.6
alecpl 14 years ago
parent 36260ed640
commit 2ae58f1b67

@ -468,8 +468,8 @@ class rcube_message
else if ($part_orig_mimetype == 'message/rfc822') { else if ($part_orig_mimetype == 'message/rfc822') {
$this->parse_structure($mail_part, true); $this->parse_structure($mail_part, true);
} }
// is a regular attachment // is a regular attachment (content-type name regexp according to RFC4288.4.2)
else if (preg_match('!^[a-z0-9-.+_]+/[a-z0-9-.+_]+$!i', $part_mimetype)) { else if (preg_match('/^[a-z0-9!#$&.+^_-]+\/[a-z0-9!#$&.+^_-]+$/i', $part_mimetype)) {
if (!$mail_part->filename) if (!$mail_part->filename)
$mail_part->filename = 'Part '.$mail_part->mime_id; $mail_part->filename = 'Part '.$mail_part->mime_id;
$this->attachments[] = $mail_part; $this->attachments[] = $mail_part;

Loading…
Cancel
Save