php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
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
Votes:9
Avg. Score:4.9 ± 0.3
Reproduced:8 of 8 (100.0%)
Same Version:7 (87.5%)
Same OS:5 (62.5%)
From: vrana@php.net Assigned: iliaa
Status: Closed Package: FTP related
PHP Version: 4CVS, 5CVS (2005-02-22) OS: win32 only
Private report: No CVE-ID:
 [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

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-02-17 16:38 UTC] 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.


 [2005-02-21 12:20 UTC] vrana@php.net
I can't see any change:

\n becomes \r\r on 5.1.0-dev (200502210730)
\n becomes \r\r on 5.0.4-dev (200502210930)
\n becomes \r\r\n on 4.3.11-dev (200502210530)

last \n becomes \r\r\n on 5.
 [2005-02-23 04:54 UTC] sniper@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php4-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-STABLE-latest.zip

There was some problem with win32 snapshots again..

 [2005-02-23 09:37 UTC] vrana@php.net
It's the same with the latest Windows snapshot :-(.
 [2005-02-23 09:59 UTC] sniper@php.net
Ilia, your fix did not work? :)

 [2005-03-11 00:38 UTC] 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.


 [2005-03-11 15:27 UTC] vrana@php.net
Works for me, thanks!
 [2010-03-05 02:22 UTC] batyafit at walla dot co dot il
Good evening. I'm glad I didn't have to fight in any war. I'm glad I didn't have to pick up a gun. I'm glad I didn't get killed or kill somebody. I hope my kids enjoy the same lack of manhood. Help me! Help to find sites on the: Ultram fatal dosage. I found only this - <a href="http://www.sasev.org/Members/Ultram">how to abuse ultram</a>. Ultram, i then post explore the law of her pain. You're away engaging to acquire a extended-release of that online min of importance properties; center by much posting around and staggering for it to test to you, ultram. :cool: Thanks in advance. Clarke from Jordan.
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Fri Apr 18 10:03:03 2014 UTC