#27633 [NEW]: Wrong translation in ASCII mode
From: vrana@php.net
Operating system: Windows XP
PHP version: 4.3.5RC3
PHP Bug Type: FTP related
Bug description: Wrong translation in ASCII mode
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 bug report at http://bugs.php.net/?id=27633&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=27633&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=27633&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=27633&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=27633&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=27633&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=27633&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=27633&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=27633&r=support
Expected behavior: http://bugs.php.net/fix.php?id=27633&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=27633&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=27633&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=27633&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=27633&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=27633&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=27633&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=27633&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=27633&r=float
Thread (17 messages)
- vrana@php.net
- iliaa@php.net#27633 [Opn->Csd]: Wrong translation in ASCII mode
- a dot hoekstra at boxitbv dot nl#27633 [Com]: Wrong translation in ASCII mode
- vrana@php.net#27633 [Csd->Opn]: Wrong translation in ASCII mode
- liuhecai at liuhecai dot com#27633 [Com]: Wrong translation in ASCII mode
- sirbinam at hotmail dot com#27633 [Com]: Wrong translation in ASCII mode
- sniper@php.net#27633 [Opn]: [PATCH] Wrong translation in ASCII mode
- sniper@php.net#27633 [Opn->Asn]: [PATCH] Wrong translation in ASCII mode
- iliaa@php.net#27633 [Asn->Csd]: [PATCH] Wrong translation in ASCII mode
- vrana@php.net#27633 [Csd->Opn]: vrana
- sniper@php.net#27633 [Opn->Fbk]: Double \r problem on ftp_get in ASCII mode on Win32
- vrana@php.net#27633 [Fbk]: Double \r problem on ftp_get in ASCII mode on Win32
- vrana@php.net#27633 [Fbk->Opn]: Double \r problem on ftp_get in ASCII mode on Win32
- sniper@php.net#27633 [Opn->Asn]: Double \r problem on ftp_get in ASCII mode on Win32
- iliaa@php.net#27633 [Asn->Csd]: Double \r problem on ftp_get in ASCII mode on Win32
- vrana@php.net#27633 [Csd]: Double \r problem on ftp_get in ASCII mode on Win32
- "Bug #27633 [Com]: Double \r problem on ftp_get in ASCII mode on Win32