Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.10.12

Bug #11344 Error at line 644 in mime.php
Submitted: 2007-06-18 07:00 UTC
From: corniflet Assigned: cipri
Status: Closed Package: Mail_Mime (version 1.5.0)
PHP Version: 4.3.9 OS: Linux
Roadmaps: 1.5.1    
Subscription  


 [2007-06-18 07:00 UTC] corniflet (Stéphane Tendon)
Description: ------------ The foreach instruction at line 644: foreach($this->_html_images as &$img){ $img['cid'] = $img['cid'].$domain; } return allways the error: Parse error: parse error, unexpected '&', expecting T_VARIABLE or '$' in /usr/local/lib/php/Mail/mime.php on line 644 Test script: --------------- <?php include('Mail.php'); include('Mail/mime.php'); $text = "<i>Hello</hi>"; $crlf = "\r\n"; $hdrs = array( "From" => "stephane.tendon@ezv.admin.ch", "Subject" => "Subject" ); $mime = new Mail_mime($crlf); $mime->setHTMLBody($text); $body = $mime->get(); $hdrs = $mime->headers($hdrs); $mail =& Mail::factory("mail"); $mail->send("stephane.tendon@ezv.admin.ch", $hdrs, $body); ?>

Comments

 [2007-06-18 14:42 UTC] johnny (Giovanni Giacobbi)
That "&" in foreach is a PHP5 feature. Can you explain how come this mistake went into stable production release? It caused damage to our websites!
 [2007-06-18 23:50 UTC] sredni (Robert Churchill)
Slightly annoying bug. Untested but presumably this would work for PHP4 (from ln 644): foreach($this->_html_images as $key=>$img){ $this->_html_images[$key]['cid'] = $img['cid'].$domain; }
 [2007-06-19 21:57 UTC] cipri (Cipriano Groenendal)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better. My apologies for this. It seems a patch I was sent accidently contained PHP5-only code. Unfortunately no-one with PHP4 ran the tests, or even tried it before I released 1.5.0-stable. I'll be releasing a quick 1.5.1 fix momentarily.
 [2007-06-20 12:30 UTC] cipri (Cipriano Groenendal)
Thank you for your bug report. This issue has been fixed in the latest released version of the package, which you can download at http://pear.php.net/get/Mail_Mime Please try Release 1.5.1