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

Bug #4749 ls() fails when connection is closed
Submitted: 2005-07-05 12:48 UTC
From: javascripter at mail dot ru Assigned: toby
Status: Closed Package: Net_FTP
PHP Version: 5.0.4 OS: Windows XP SP2
Roadmaps: (Not assigned)    
Subscription  


 [2005-07-05 12:48 UTC] javascripter at mail dot ru
Description: ------------ A call to Net_FTP::ls() fails with Fatal Error when connection is closed by the server. If I'm right, the problem lies in _ls_both($dir) function which misses PEAR::isError($list_splitted) check. Reproduce code: --------------- The following piece of code function _ls_both($dir) { $list_splitted = $this->_list_and_parse($dir); if (!is_array($list_splitted["files"])) { $list_splitted["files"] = array(); } [...skipped...] } should look like function _ls_both($dir) { $list_splitted = $this->_list_and_parse($dir); if (PEAR::isError($list_splitted)) { return $list_splitted; } if (!is_array($list_splitted["files"])) { $list_splitted["files"] = array(); } [...skipped...] } Actual result: -------------- Fatal Error: Cannot use object of type PEAR_Error as array in C:\Server\php5\PEAR\Net\FTP.php on line 1924

Comments

 [2006-02-09 22:54 UTC] toby
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.