[imp] Obscure attachment bug in IMP 3.x (RELENG_3)

Viljo Viitanen vviitane+mail.imp at mappi.helsinki.fi
Tue Dec 28 02:27:40 PST 2004


http://cvs.horde.org/co.php/imp/lib/IMP.php?r=1.198.2.67 line 1025, function
partSummary:

        if (!($mime->size > 0)) {
             // don't display zero-size attachments
             return '';
         }

This behaves wrong if locale's decimal separator is not "." (in many
locales, it is ",") and the attachment size is under 1 KB. Mime->size then
is e.g. "0,1" which evaluates to 0.

I fixed this in our installation by changing to if ($mime->size == "0"). I
hope it works as expected (i don't have an email with a zero-size attachment
to test this with).

-- 
Viljo Viitanen
University of Helsinki


More information about the imp mailing list