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

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)    
Subscription  


 [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; }

Comments

 [2004-05-24 03:52 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!