[Svn] r3018 - trunk/roundcubemail/program/lib

trac at roundcube.net trac at roundcube.net
Mon Oct 5 11:26:33 CEST 2009


Author: alec
Date: 2009-10-05 04:26:33 -0500 (Mon, 05 Oct 2009)
New Revision: 3018

Modified:
   trunk/roundcubemail/program/lib/imap.inc
Log:
- improve Content-type header parsing


Modified: trunk/roundcubemail/program/lib/imap.inc
===================================================================
--- trunk/roundcubemail/program/lib/imap.inc	2009-10-05 07:25:03 UTC (rev 3017)
+++ trunk/roundcubemail/program/lib/imap.inc	2009-10-05 09:26:33 UTC (rev 3018)
@@ -1592,13 +1592,10 @@
 						$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':

_______________________________________________
http://lists.roundcube.net/mailman/listinfo/svn



More information about the Svn mailing list