ID: 27633
Updated by: sniper@php.net
-Summary: Wrong translation in ASCII mode
Reported By: vrana@php.net
Status: Open
Bug Type: FTP related
Operating System: Windows XP
PHP Version: 4.3.8
New Comment:
http://www.binam.net/bug-27633.patch
Previous Comments:
------------------------------------------------------------------------
[2004-12-11 00:11:58] sirbinam at hotmail dot com
I submitted a patch to the internals list. It worked for me. :)
------------------------------------------------------------------------
[2004-07-23 17:55:56] vrana@php.net
\n becomes \r\r\n in PHP 4.3.8.
\n becomes \r\r in PHP 5.0.0 (last \n becomes \r\r\n).
------------------------------------------------------------------------
[2004-07-23 16:38:01] a dot hoekstra at boxitbv dot nl
Upgraded from 4.3.1 to 4.3.8.
After upgrade I got extra <cr> at end of line
when ftp in ascii mode from unix host to xp client.
In case of large file (+3kb) missing tail of file and no error
message!
Downgraded again to 4.3.1 to make things work :-(.
------------------------------------------------------------------------
[2004-03-18 12:07:48] iliaa@php.net
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
------------------------------------------------------------------------
[2004-03-18 07:27:30] 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
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=27633&edit=1