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

Bug #1280 Net_IMAP::connect() always returns a pear error
Submitted: 2004-04-25 15:37 UTC
From: pear at oak-wood dot co dot uk Assigned: damian
Status: Closed Package: Net_IMAP
PHP Version: 4.3.2 OS: FreeBSD 5.1
Roadmaps: (Not assigned)    

 [2004-04-25 15:37 UTC] pear at oak-wood dot co dot uk
Description: ------------ Using 0.7.1 Net_IMAP::connect() tests for a particular value in an array returned by cmdConnect(), but cmdConnect() does not return an array! It returns true on success and a PEAR error on failure. The result is that Net_IMAP::connect() always returns a PEAR error, even when it is successful. It appears that this may also apply to the constructor method. This fixes it, but I'm sure it could be improved on: --- IMAP.php.orig Sat Apr 24 12:24:37 2004 +++ IMAP.php Sun Apr 25 10:05:20 2004 @@ -70,8 +70,8 @@ function connect($host, $port) { $ret=$this->cmdConnect($host,$port); - if(strtoupper($ret["RESPONSE"]["CODE"]) != "OK"){ - return new PEAR_Error($ret["RESPONSE"]["CODE"] . ", " . $ret["RESPONSE"]["STR_CODE"]); + if(empty($ret)){ + return new PEAR_Error("Unexpected response on connection"); } return $ret; }


 [2004-05-24 03:52 UTC] damian
Thank you for your bug report. This issue has been fixed in the latest released version of the package, which you can download at Release 1.0.0 fixes this