Home » Networking » Net_FTP » Bug #918
getRecursive() corrupts binary file
Details
| 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) |
Comments
[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"];