Mail/RFC822.php
| From: | Richard Bateman | Date: | Fri, 26 Sep 2003 02:21:00 +0000 |
| Subject: | Mail/RFC822.php | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-22052@lists.php.net to get a copy of this message | ||
I don't know who this needs to go to, so I am sending it here. I have recently started using the PEAR Mail classes, including the file RFC822.php
I have had to copy it outside of my PEAR dir structure because as packaged I am unable to use it. In the code there is a line that has a potential (and frequent) Notice on it that is blocked with an "@" symbol. PLEASE PLEASE PLEASE do not do this in your code. We use a custom error handler which catches all notices (as potential data errors) and kills the script, and if this error is there it will get thrown whether or not there is an "@" on the line. Many are not aware of this problem (I wasn't until recently)
If someone is in a position to fix the file, I do not know how to create a patch, but starting on line 623 (I think), the code needs to be changed as follows to make it work:
if (isset($comments)){
for($i=0; $i<count($comments); $i++)
{
$mailbox = str_replace('('.$comments[$i].')', '', $mailbox);
}
}
simply putting that if statement around the for loop is sufficient to fix the problem. We would love to be able to use updates to this library, but at the moment it would simply break our code again. Please reply to my address (richardb@byu.edu) if you can tell me what to do to get this fixed in the PEAR repo.
Thank you very much for your time
Richard