Home » Mail » Mail_Mime » Bug #7265
Only variable references should be returned by reference
Details
| Submitted | 2006-03-30 16:47 UTC |
|---|---|
| From | busby at edoceo dot com |
| Assigned | cipri |
| Status | Bogus |
| Package | Mail_Mime |
| PHP Version | 5.1.2 |
| OS | Gentoo Linux |
| Roadmaps | (Not assigned) |
Comments
[2006-03-30 16:47 UTC] busby at edoceo dot com
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;
}
/**
[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