PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Mail » Mail_Mime » Bug #7265

Only variable references should be returned by reference

Details

Submitted2006-03-30 16:47 UTC
Frombusby at edoceo dot com
Assignedcipri
StatusBogus
PackageMail_Mime
PHP Version5.1.2
OSGentoo 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