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

MimeDecode php5 fatal error

Details

Submitted2004-09-11 03:47 UTC
Fromblade at lansmash dot com
StatusDuplicate
PackageMail_Mime
PHP Version5.0.0
OSMac OS X
Roadmaps(Not assigned)

Comments

[2004-09-11 03:47 UTC] blade at lansmash dot com

Description:
------------
Using the latest CVS version of mimeDecode.php I receive
a "Fatal error: Using $this when not in object context"
on line 189 of mimeDecode.php.

This seems to be only a problem with php5. I have tried
by-passing the 'if' statement and declaring the object
statically, however this results in a timeout with the
php process crashing. Ouch.

Works in php4.

This is NOT a duplicate of http://pear.php.net/bugs/
bug.php?id=2113. This is mimeDecode.php. Email
receiving, not email sending.

Reproduce code:
---------------
function decode($params = null)
{

// Have we been called statically? If so, create an object and pass details to that.
if (!isset($this->mailMimeDecode) AND isset($params['input'])) {

$obj = new Mail_mimeDecode($params['input']);
$structure = $obj->decode($params);

// Called statically but no input
} elseif (!isset($this->mailMimeDecode)) {
return PEAR::raiseError('Called statically and no input given');

// Called via an object
} else {
$this->_include_bodies = isset($params['include_bodies']) ? $params['include_bodies'] : false;
$this->_decode_bodies = isset($params['decode_bodies']) ? $params['decode_bodies'] : false;
$this->_decode_headers = isset($params['decode_headers']) ? $params['decode_headers'] : false;

$structure = $this->_decode($this->_header, $this->_body);
if ($structure === false) {
$structure = $this->raiseError($this->_error);
}
}

return $structure;
}

Expected result:
----------------
Proper return of $structure.

Actual result:
--------------
Fatal error: Using $this when not in object context

[2004-09-11 03:49 UTC] blade at lansmash dot com

Whoops, wrong section - it's meant to go in Mail_Mime