summaryrefslogtreecommitdiff
path: root/roundcubemail/program
diff options
context:
space:
mode:
authoralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2009-10-05 09:26:33 +0000
committeralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2009-10-05 09:26:33 +0000
commit46faf91019d06277302d4fb169f285a866f0bc3d (patch)
treee052ea20d7ffa4ec65e441f812f040f327914e92 /roundcubemail/program
parent74391a446cd0e68fe2f3f402a74ac95cea2a7a53 (diff)
- improve Content-type header parsing
git-svn-id: https://svn.roundcube.net/trunk@3018 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program')
-rw-r--r--roundcubemail/program/lib/imap.inc9
1 files changed, 3 insertions, 6 deletions
diff --git a/roundcubemail/program/lib/imap.inc b/roundcubemail/program/lib/imap.inc
index 437ea5949..9d896ffe0 100644
--- a/roundcubemail/program/lib/imap.inc
+++ b/roundcubemail/program/lib/imap.inc
@@ -1592,13 +1592,10 @@ function iil_C_FetchHeaders(&$conn, $mailbox, $message_set, $uidfetch=false, $bo
$result[$id]->encoding = $string;
break;
case 'content-type':
- $ctype_parts = explode(";", $string);
+ $ctype_parts = preg_split('/[; ]/', $string);
$result[$id]->ctype = array_shift($ctype_parts);
- foreach ($ctype_parts as $ctype_add) {
- if (preg_match('/charset="?([a-z0-9\-\.\_]+)"?/i',
- $ctype_add, $regs)) {
- $result[$id]->charset = $regs[1];
- }
+ if (preg_match('/charset\s*=\s*"?([a-z0-9\-\.\_]+)"?/i', $string, $regs)) {
+ $result[$id]->charset = $regs[1];
}
break;
case 'in-reply-to':