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

Bug #7265 Only variable references should be returned by reference
Submitted: 2006-03-30 16:47 UTC
From: busby at edoceo dot com Assigned: cipri
Status: Bogus Package: Mail_Mime (version 1.3.1)
PHP Version: 5.1.2 OS: Gentoo Linux
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 28 + 9 = ?

 
 [2006-03-30 16:47 UTC] busby at edoceo dot com (David Busby)
Description: ------------ I use error_reporting(E_ALL); in my scripts. I see this error message Notice: Only variable references should be returned by reference in /usr/share/php/Mail/mime.php on line 375 Notice: Only variable references should be returned by reference in /usr/share/php/Mail/mime.php on line 593 Test script: --------------- $hdrs = array( 'Errors-To'=>$from, 'From'=>$from, 'Reply-To'=>$from, 'Subject'=>$cq->name ); $mime = new Mail_mime("\n"); $mime->setTXTBody($text); $mime->setHTMLBody("<html>\n<body>\n$html\n</body>\n</html>"); $body = $mime->get(); $hdrs = $mime->headers($hdrs); $mail = Mail::factory('mail'); $mail->send('busby@edoceo.com', $hdrs, $body); Expected result: ---------------- I expect not to see the Notice: messages. The message is still sent as Notice does not kill the script. In the Actual Result section is a Patch of changes I made that got rid of the errors. Actual result: -------------- --- mime.php4 2006-03-30 08:25:44.000000000 -0800 +++ mime.php5 2006-03-30 08:31:15.000000000 -0800 @@ -372,7 +372,8 @@ if (is_object($obj)) { return $obj->addSubpart('', $params); } else { - return new Mail_mimePart('', $params); + $x = new Mail_mimePart('', $params); + return $x; } } @@ -590,7 +591,8 @@ } $this->_headers = array_merge($headers, $this->_headers); - return $this->_encodeHeaders($this->_headers); + $x = $this->_encodeHeaders($this->_headers); + return $x; } /**

Comments

 [2006-03-30 16:49 UTC] busby at edoceo dot com
Patch as been wrapped, oops! Full patch at http://www.edoceo.com/dl/mime.php5.patch
 [2006-04-01 10:28 UTC] cipri (Cipriano Groenendal)
Please do not submit the same bug more than once. An existing bug report already describes this very problem. Even if you feel that your issue is somewhat different, the resolution is likely to be the same. Because of this, we hope you add your comments to the existing bug instead. Thank you for your interest in PEAR. Please try CVS Version 1.43. This is a duplicate of Bug #5333