On Tuesday 15 May 2007 09:10, Tomas Kuliavas wrote:
> "If delimiter contains a value that is not contained in string, then
> explode() will return an array containing string."
>
> is_array() test is useless. $type is always array.
Yes. I think that code was an error that was never corrected. The log message
is in the style of "many cleanups" :-( but it contains added fallbacks for
the other parsed headers aswell. I think this was intended as a fallback for
a broken header but never actually tested.
I propose to fix it with attached patch. That should catch every deranged
header we might encounter.
Thijs
Index: imap_messages.php
===================================================================
--- imap_messages.php (revision 12395)
+++ imap_messages.php (working copy)
@@ -670,9 +670,12 @@
$type = substr($type, 0, $pos);
}
$type = explode("/", $type);
- if(!is_array($type)) {
+ if ( empty($type[0]) ) {
$type[0] = 'text';
}
+ if ( empty($type[1]) ) {
+ $type[1] = 'plain';
+ }
break;
default: break;
}
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
--
squirrelmail-users mailing list
Posting Guidelines: http://www.squirrelmail.org/wiki/MailingListPostingGuidelines
List Address: squirrelmail-users@xxxxxxxxxxxxxxxxxxxxx
List Archives: http://news.gmane.org/thread.php?group=gmane.mail.squirrelmail.user
List Archives: http://sourceforge.net/mailarchive/forum.php?forum_id=2995
List Info: https://lists.sourceforge.net/lists/listinfo/squirrelmail-users