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 #8312

Only variable references should be returned by reference

Details

Submitted2006-07-28 10:07 UTC
Fromross at golder dot org
Assignedcipri
StatusBogus
PackageMail_Mime
PHP Version5.1.4
OSUbuntu Dapper
Roadmaps(Not assigned)

Comments

[2006-07-28 10:07 UTC] ross at golder dot org

Description:
------------
Notice: Only variable references should be returned by reference in /usr/share/php/Mail/mime.php on line 320

Notice: Only variable references should be returned by reference in /usr/share/php/Mail/mime.php on line 593

Notice: Only variable references should be returned by reference in /usr/share/php/Mail/mime.php on line 356

Notice: Only variable references should be returned by reference in /usr/share/php/Mail/mime.php on line 434

Notice: Only variable references should be returned by reference in /usr/share/php/Mail/mime.php on line 593

Warning: Cannot modify header information - headers already sent by...

Test script:
---------------
Sorry, not enough time. Patched locally already.

Expected result:
----------------
No warnings/notices.

Actual result:
--------------
Lots of notices.

[2006-07-28 10:11 UTC] ross at golder dot org

Well, I would attach my local patch but I can't seem to figure out how. Daft bug tracker. Here it is cut'n'pasted:

--- mime.php.orig 2006-07-28 16:57:28.000000000 +0700
+++ mime.php 2006-07-28 17:00:14.000000000 +0700
@@ -315,10 +315,11 @@
$params['encoding'] = $this->_build_params['text_encoding'];
$params['charset'] = $this->_build_params['text_charset'];
if (is_object($obj)) {
- return $obj->addSubpart($text, $params);
+ $part = $obj->addSubpart($text, $params);
} else {
- return new Mail_mimePart($text, $params);
+ $part = new Mail_mimePart($text, $params);
}
+ return $part;
}

/**
@@ -353,7 +354,8 @@
function &_addMixedPart()
{
$params['content_type'] = 'multipart/mixed';
- return new Mail_mimePart('', $params);
+ $part = new Mail_mimePart('', $params);
+ return $part;
}

/**
@@ -430,7 +432,8 @@
$params['encoding'] = $value['encoding'];
$params['disposition'] = 'attachment';
$params['dfilename'] = $value['name'];
- $obj->addSubpart($value['body'], $params);
+ $part = $obj->addSubpart($value['body'], $params);
+ return $part;
}

/**
@@ -590,7 +593,8 @@
}
$this->_headers = array_merge($headers, $this->_headers);

- return $this->_encodeHeaders($this->_headers);
+ $headers = $this->_encodeHeaders($this->_headers);
+ return $headers;
}

/**

[2006-09-12 16:50 UTC] bytewise at gmx dot net

Patch works for me (and I had the same problem). Please accept this patch.