summaryrefslogtreecommitdiff
path: root/program/include
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2010-10-20 11:27:39 +0000
committeralecpl <alec@alec.pl>2010-10-20 11:27:39 +0000
commit2ae58f1b6782ad03cb4801b1eb2684f0d9351b32 (patch)
treeb228a40483685a53f0f6c680c7d86bad83c36c2f /program/include
parent36260ed640210ee116af30845bfc90d832881222 (diff)
- Fix content-type name regexp according to RFC4288.4.2
Diffstat (limited to 'program/include')
-rw-r--r--program/include/rcube_message.php14
1 files changed, 7 insertions, 7 deletions
diff --git a/program/include/rcube_message.php b/program/include/rcube_message.php
index 2b793c441..ec1359c86 100644
--- a/program/include/rcube_message.php
+++ b/program/include/rcube_message.php
@@ -45,7 +45,7 @@ class rcube_message
private $opt = array();
private $inline_parts = array();
private $parse_alternative = false;
-
+
public $uid = null;
public $headers;
public $structure;
@@ -55,7 +55,7 @@ class rcube_message
public $subject = '';
public $sender = null;
public $is_safe = false;
-
+
/**
* __construct
@@ -105,8 +105,8 @@ class rcube_message
// notify plugins and let them analyze this structured message object
$this->app->plugins->exec_hook('message_load', array('object' => $this));
}
-
-
+
+
/**
* Return a (decoded) message header
*
@@ -124,7 +124,7 @@ class rcube_message
return $raw ? $value : $this->imap->decode_header($value);
}
-
+
/**
* Set is_safe var and session data
*
@@ -468,8 +468,8 @@ class rcube_message
else if ($part_orig_mimetype == 'message/rfc822') {
$this->parse_structure($mail_part, true);
}
- // is a regular attachment
- else if (preg_match('!^[a-z0-9-.+_]+/[a-z0-9-.+_]+$!i', $part_mimetype)) {
+ // 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)) {
if (!$mail_part->filename)
$mail_part->filename = 'Part '.$mail_part->mime_id;
$this->attachments[] = $mail_part;