PHP 5.3 messes up Ilohamail with errors including:

PHP Warning:  Variable passed to each() is not an array or object in
/home/megapico/webmail/include/mime.inc on line 12
PHP Warning:  strcasecmp() expects parameter 1 to be string, array given
in /home/megapico/webmail/include/mime.inc on line 106

A patch to fix it is given here by Neale Pickett:
http://bugs.debian.org/cgi-bin/pkgreport.cgi?ordering=normal;archive=0;src=ilohamail;repeatmerged=0

Details of the patch are:

--- mime.inc~   2004-11-30 00:25:40.000000000 -0600
+++ mime.inc    2011-02-21 17:12:51.000000000 -0600
@@ -84,7 +84,7 @@
     $line = str_replace(")(", ") (", $line);

        $struct = iml_ParseBSString($line);
-       if ((strcasecmp($struct[0], "message")==0) && (strcasecmp($struct[1],
"rfc822")==0)){
+       if (is_string($struct[0]) && (strcasecmp($struct[0], "message")==0)
&& (strcasecmp($struct[1], "rfc822")==0)){
                $struct = array($struct);
        }
     return $struct;
@@ -97,13 +97,13 @@
                $pos = strpos($part, ".");
                $rest = substr($original_part, $pos+1);
                $part = substr($original_part, 0, $pos);
-               if ((strcasecmp($a[0], "message")==0) && (strcasecmp($a[1],
"rfc822")==0)){
+               if (is_string($a[0]) && (strcasecmp($a[0], "message")==0) &&
(strcasecmp($a[1], "rfc822")==0)){
                        $a = $a[8];
                }
                //echo "m - part: $original_part current: $part rest: $rest 
array:
".implode(" ", $a)."<br>\n";
                return iml_GetPartArray($a[$part-1], $rest);
        }else if ($part>0){
-               if ((strcasecmp($a[0], "message")==0) && (strcasecmp($a[1],
"rfc822")==0)){
+               if (is_string($a[0]) && (strcasecmp($a[0], "message")==0) &&
(strcasecmp($a[1], "rfc822")==0)){
                        $a = $a[8];
                }
                //echo "s - part: $part rest: $rest array: ".implode(" ",
$a)."<br>\n";
@@ -118,7 +118,7 @@
        if (is_array($a)){
                $parent=iml_GetPartArray($a, $part);

-               if ((strcasecmp($parent[0], "message")==0) &&
(strcasecmp($parent[1], "rfc822")==0)){
+               if (is_string($parent[0]) && (strcasecmp($parent[0], 
"message")==0)
&& (strcasecmp($parent[1], "rfc822")==0)){
                        $parent = $parent[8];
                }




-----------------------------
Email: [email protected]
Web: http://www.megapico.co.uk/
-----------------------------

-----------------------------
Email: [email protected]
Web: http://www.megapico.co.uk/
-----------------------------

------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software 
be a part of the solution? Download the Intel(R) Manageability Checker 
today! http://p.sf.net/sfu/intel-dev2devmar
_______________________________________________
Ilohamail-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ilohamail-users

Reply via email to