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

Bug #9956 Notices being thrown
Submitted: 2007-01-27 03:32 UTC
From: lturmelle at guamcell dot com Assigned: cipri
Status: Closed Package: Mail_Mime (version 1.3.1)
PHP Version: 5.1.4 OS: xp sp2
Roadmaps: 1.4.0, 1.4.0a1    
Subscription  


 [2007-01-27 03:32 UTC] lturmelle at guamcell dot com (Ligaya Turmelle)
Description: ------------ Various places in the class are now throwing E_NOTICE for returning executed code instead of a variable. This is with E_STRICT turned off in this PHP version. Have also had the error thrown on lines 356 and 434 - though not on the provided test script. Test script: --------------- <?php error_reporting(E_ALL); require 'Mail.php'; require 'Mail/mime.php'; $mime = new Mail_mime("\r\n"); $mime->setTXTBody('Howdy'); $body = $mime->get(); $hdrs = $mime->headers(array( 'From' => 'lig@mydomain.com', 'Subject' => 'Howdy' ) ); $mail = Mail::factory('smtp', array('host'=>'smtp.myisp.net')); echo ($mail->send('lig@anotherdomain.com', $hdrs, $body)) ? 'TRUE' : 'FALSE'; ?> Expected result: ---------------- TRUE Actual result: -------------- <br /> <b>Notice</b>: Only variable references should be returned by reference in <b>C:\php\PEAR\Mail\mime.php</b> on line <b>320</b><br /> <br /> <b>Notice</b>: Only variable references should be returned by reference in <b>C:\php\PEAR\Mail\mime.php</b> on line <b>593</b><br /> TRUE

Comments

 [2007-01-29 10:37 UTC] lturmelle at guamcell dot com
I haven't used PHP4 OO in a long time and these are a bit ugly - but they seem to work for me. Here is a few patches for this report : mime.php Line 356 - return new Mail_mimePart('', $params); + $var = &new Mail_mimePart('', $params); + return $var; mime.php Line 320 - return new Mail_mimePart($text, $params); + $var = &new Mail_mimePart($text, $params); + return $var; mime.php Line 593 - $this->_headers = array_merge($headers, $this->_headers); - return $this->_encodeHeaders($this->_headers); + $var = array_merge($headers, $this->_headers); + $this->_headers = $var; + $var2 = &$this->_encodeHeaders($this->_headers); + return $var2;
 [2007-01-30 16:38 UTC] m at mattanjakern dot de (Mattanja Kern)
Same problem here... Is this package maintained no longer? Full diff for that problem should be the following. --- mime.php.old 2007-01-30 19:11:22.000000000 +0100 +++ mime.php 2007-01-30 19:14:14.000000000 +0100 @@ -317,7 +317,8 @@ if (is_object($obj)) { return $obj->addSubpart($text, $params); } else { - return new Mail_mimePart($text, $params); + $tmp = &new Mail_mimePart($text, $params); + return $tmp; } } @@ -338,7 +339,8 @@ if (is_object($obj)) { return $obj->addSubpart($this->_htmlbody, $params); } else { - return new Mail_mimePart($this->_htmlbody, $params); + $tmp = &new Mail_mimePart($this->_htmlbody, $params); + return $tmp; } } @@ -353,7 +355,8 @@ function &_addMixedPart() { $params['content_type'] = 'multipart/mixed'; - return new Mail_mimePart('', $params); + $tmp = &new Mail_mimePart('', $params); + return $tmp; } /** @@ -372,7 +375,8 @@ if (is_object($obj)) { return $obj->addSubpart('', $params); } else { - return new Mail_mimePart('', $params); + $tmp = &new Mail_mimePart('', $params); + return $tmp; } } @@ -392,7 +396,8 @@ if (is_object($obj)) { return $obj->addSubpart('', $params); } else { - return new Mail_mimePart('', $params); + $tmp = &new Mail_mimePart('', $params); + return $tmp; } } @@ -590,7 +595,9 @@ } $this->_headers = array_merge($headers, $this->_headers); - return $this->_encodeHeaders($this->_headers); + $tmp = $this->_encodeHeaders($this->_headers); + $tmp_p = &$tmp; + return $tmp_p; } /**
 [2007-02-14 13:00 UTC] bretrzaun at hotmail dot com (Bret R. Zaun)
Same problem here - would like to get an new release instead of patching the file. Is anyone listening ?
 [2007-03-08 00:30 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!
 [2007-05-05 15:07 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!