Double \r problem on ftp_get in ASCII mode on Win32
| Bug #27633 | Double \r problem on ftp_get in ASCII mode on Win32 | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Submitted: | 2004-03-18 07:27 UTC | Modified: | 2005-03-11 15:27 UTC |
|
||||||||||
| From: | vrana@php.net | Assigned: | iliaa (profile) | |||||||||||
| Status: | Closed | Package: | FTP related | |||||||||||
| PHP Version: | 4CVS, 5CVS (2005-02-22) | OS: | win32 only | |||||||||||
| Private report: | No | CVE-ID: | None | |||||||||||
[2004-03-18 07:27 UTC] vrana@php.net
Description:
------------
ftp_get() translates \n characters wrong in FTP_ASCII mode. Instead of \r\n, they become \r on Windows. Only newline at the end of a file (if any) is translated correct.
\r\n on remote server become \r\r.
Reproduce code:
---------------
<?php
$ftp = ftp_connect("ftp.netscape.com");
ftp_login($ftp, "anonymous", "anonymous");
ftp_pasv($ftp, true);
ftp_get($ftp, "Welcome", "Welcome", FTP_ASCII);
ftp_close($ftp);
?>
Expected result:
----------------
\r\nWelcome ...\r\n
Actual result:
--------------
\rWelcome ...\r\n
Patches
Pull Requests
History
AllCommentsChangesGit/SVN commits
[2005-02-17 16:38 UTC] iliaa@php.net
[2005-02-21 12:20 UTC] vrana@php.net
[2005-02-23 09:37 UTC] vrana@php.net
[2005-03-11 00:38 UTC] iliaa@php.net
[2010-03-05 02:22 UTC] batyafit at walla dot co dot il