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  


 [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] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!