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

Bug #918 getRecursive() corrupts binary file
Submitted: 2004-02-27 13:03 UTC
From: ipa at beta dot lt Assigned: toby
Status: Closed Package: Net_FTP
PHP Version: 4.3.4 OS: All
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 46 + 2 = ?

 
 [2004-02-27 13:03 UTC] ipa at beta dot lt
Description: ------------ All binary files downloaded using getRecursive method are broken because they are transferred in FTP_TEXT mode. The problem is in bug in code where $mode variable is reassigned. the patch can be applied to version 1.8 to fix this --- FTP.php 2004-02-27 15:07:02.000000000 +0200 +++ FTP.patched.php 2004-02-27 15:07:02.000000000 +0200 @@ -741,7 +741,7 @@ class Net_FTP extends PEAR } } $dir_list = array(); - $dir_list = $this->ls($remote_path, $mode = NET_FTP_DIRS_ONLY); + $dir_list = $this->ls($remote_path, NET_FTP_DIRS_ONLY); foreach ($dir_list as $dir_entry) { $remote_path_new = $remote_path.$dir_entry["name"]."/"; $local_path_new = $local_path.$dir_entry["name"]."/"; @@ -751,7 +751,7 @@ class Net_FTP extends PEAR } } $file_list = array(); - $file_list = $this->ls($remote_path, $mode = NET_FTP_FILES_ONLY); + $file_list = $this->ls($remote_path, NET_FTP_FILES_ONLY); foreach ($file_list as $file_entry) { $remote_file = $remote_path.$file_entry["name"]; $local_file = $local_path.$file_entry["name"];

Comments

 [2004-03-14 13:21 UTC] toby
This bug has been fixed in CVS. In case this was a documentation problem, the fix will show up at the end of next Sunday (CET) on pear.php.net. In case this was a pear.php.net website problem, the change will show up on the website in short time. Thank you for the report, and for helping us make PEAR better.