Edit report at https://pear.php.net/bugs/bug.php?id=16819&edit=1
ID: 16819
Updated by: daniel.oconnor@gmail.com
Reported By: sam at archives dot org dot au
Summary: IMAPProtocol::cmdStatus fails on error
Status: Open
Type: Bug
Package: Net_IMAP
Operating System: MacOS
Package Version: 1.1.0
PHP Version: 5.2.5
Roadmap Versions:
New Comment:
Thanks for the patch Sam. It's been a while since you uploaded it, and
no reply - so
I'm marking the package unmaintained.
Previous Comments:
------------------------------------------------------------------------
[2009-11-22 04:17:46] samwilson
Added #patch
bug:16819;patch:IMAPProtocol_1-1-0.patch;revision:1258863466;.
------------------------------------------------------------------------
[2009-11-22 04:15:42] samwilson
Description:
------------
The return value of $this->_genericCommand needs to be checked before it
is used as an array (it might be a PEAR_Error).
Test script:
---------------
require_once 'Net/IMAP.php';
$imap = new Net_IMAP('mail.example.org');
$login = $imap->login('username', 'password');
$imap->numMsg();
Expected result:
----------------
[Nothing]
Actual result:
--------------
Fatal error: Cannot use object of type PEAR_Error as array in
/home/user/pear/PEAR/Net/IMAPProtocol.php on line 1038
------------------------------------------------------------------------