[cvs] commit: imp message.php imp/docs CHANGES imp/lib IMP.php

Jon Parise jon@csh.rit.edu
Sun, 5 Nov 2000 15:40:05 -0500


On Sun, Nov 05, 2000 at 08:21:35PM -0000, jon@horde.org wrote:

>   Cleanly handle the 'undisclosed-recipients' case.

Please make sure I didn't break anything with this code.  I rewrote a
bit of the relevant functions in the process.  I also added a lot of
comments, so they should help you figure out what I was doing.

I found some redundant initialization checks in buildAddressLinks
(message.php) and IMP::addrObject2String (lib/IMP.php).  They look
like this:

$ob->personal = isset($ob->personal) ?  mime_decode($ob->personal) : '';
if (!isset($ob->mailbox)) $ob->mailbox = '';
if (!isset($ob->host)) $ob->host = '';

The first test in buildAddressLinks should be sufficient (because
IMP::addrObject2String is called after these checks are made), so they
can be safely removed from IMP::addrObject2String.  However, it's
probably a good idea for IMP::addrObject2String to validate its own
input in the case where it's called from some other routine that
doesn't check those values.  With that reasoning, these checks could
be removed from buildAddressLinks, except for the fact that they're
also used in buildAddressLinks and there will be problems if those
values aren't initialized.  So that's why the checks are in both
places.

-- 
Jon Parise (jon@csh.rit.edu)  .  Rochester Inst. of Technology
http://www.csh.rit.edu/~jon/  :  Computer Science House Member