[PATCH] Fix PHP Warning in imap.php

Mark Bucciarelli mark at gaiahost.coop
Wed Apr 26 23:11:14 CEST 2006

With debug_level = 4, I was getting the following warning output
when I clicked on a folder:

    Warning: mktime() expects parameter 5 to be long, string given in
    on line 625

The message index would not display sometimes; for example, 
    1. click on trash
    2. drag message (unread) to inbox
    3. click on inbox (yup, msg there)
    4. click on trash (no message index displayed)

Very strange, as when I viewed the source the table that display the
message index was there.

When I fixed the warning by casting to an int, the behavior was fixed.

# diff -u program/lib/imap.inc.orig
--- program/lib/imap.inc.orig   Wed Apr 26 17:01:40 2006
+++ program/lib/imap.inc        Wed Apr 26 17:03:01 2006
@@ -611,7 +611,7 @@
-       $day=$a[0];
+       $day=(int)$a[0];
        $tz_str = $a[4];

I'll stick this (and my README patch) in sf.net as a patch so it doesn't
get lost in the mailing list.

Mark Bucciarelli
GAIA Host Collective, LLC
web: http://www.gaiahost.coop
"Reliable internet solutions from an environmentally
and socially concerned worker collective"

More information about the Dev mailing list