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 » Networking » Net_IMAP » Bug #3438

disconnect() method generates PHP error

Details

Submitted2005-02-11 21:30 UTC
Frommiker at life-captured dot com
Assignedamistry
StatusClosed
PackageNet_IMAP
PHP Version5.0.3
OSGNU/Linux
Roadmaps(Not assigned)

Comments

[2005-02-11 21:30 UTC] miker at life-captured dot com

Description:
------------
When calling disconnect() method for Net_IMAP object, a PHP fatal error is generated.

Reproduce code:
---------------
...
require_once('Net/IMAP.php');
...
$imap = new Net_IMAP($host, $port);
print ("Connected successfully...\n");
...
$ret = $imap->disconnect();
/*
ERROR OCCURS HERE!!!!
*/
print "Logout result = " . $ret . "\n";

Expected result:
----------------
Connected successfully...
Logout result = * BYE IMAP4rev1 Server terminating connection

Actual result:
--------------
Connected successfully...
<br />
<b>Fatal error</b>: Cannot use string offset as an array in <b>/usr/local/lib/php/Net/IMAP.php</b> on line <b>180</b><br />

[2005-10-15 18:21 UTC] oliver at realtsp dot com

Hi there

I was getting the same error for some time. Net_IMAP v1.0.3 php version 5.0.3.

I looked at the code in IMAPProtocol.php Line 701 in the cmdLogout() function.

if you change this:
return $args;
// not for now
//return $this->_genericImapResponseParser($args,$cmdid);

to this

return $this->_genericImapResponseParser($args,$cmdid);

(ie uncomment the proper processing of the return arguments)

then it works fine!

Not sure why these were ever commented out..??

Regards

Oliver

[2006-03-22 04:38 UTC] amistry at php dot net

I've committed a fix for this in the CVS. Please verify it works for you.

[2006-08-09 07:01 UTC] tom at tiri dot li

I tried out the above setting, then the fatal error is gone away - but now I got the error

Notice: Undefined variable: command in /usr/share/php/Net/IMAPProtocol.php on line 2709

Greetings

Thomas
http://inhalt.serviert.de

[2006-09-09 21:40 UTC] amistry at php dot net

Do you see this in the CVS version?

[2006-11-08 07:44 UTC] feathercat317 at yahoo dot com

ALL I WANT IS OUT

[2006-11-26 18:19 UTC] mortonda at dgrmm dot net

I also ran into the Undefined variable: command problem, and resolved by changing $command to $token on line around 2707 or 2709

[2007-02-12 22:00 UTC] hudeldudel at php dot net

I can not reproduce this with current CVS version.
My unit tests don't show this error.