From: jan+php at jancm dot org
Operating system: Win2K
PHP version: 4.3.1
PHP Bug Type: FTP related
Bug description: fopen with ftp url
fopen will, apparently, always open a pasv mode data connection (to a ftp
type url). Most ftp servers return a code of:
150 "File status okay; about to open data connection",
but in some cases they return a
125 "125 Data connection already open; transfer starting."
(It really depends on the server. WarFTP will return a 125);
fopen works fine when a 150 is returned. It breaks when a 125 is returned
instead.
I *think* the only change needed is in line 418 of
ext\standard\ftp_fopen_wrapper.c (based on 4.3.1 source), but I can't
compile it to check. :(
Currently it reads:
if (result != 150) {
and I think it should be:
if (result != 150 && result != 125) {
References:
RFC 959
also see ext\ftp\ftp.c
lines: 683, 765, 1473, 1581, and 1694
(the ftp functions all work fine in both passive and active modes).
--
Edit bug report at http://bugs.php.net/?id=22402&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=22402&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=22402&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=22402&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=22402&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=22402&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=22402&r=support
Expected behavior: http://bugs.php.net/fix.php?id=22402&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=22402&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=22402&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=22402&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=22402&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=22402&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=22402&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=22402&r=gnused