From:             ky dot patterson at adlinkr dot com
Operating system: Linux
PHP version:      5.5.0RC1
Package:          FTP related
Bug Type:         Bug
Bug description:ftp_put() returns FALSE for some 2xx FTP response codes

Description:
------------
Function ftp_put() should return TRUE (success) when it receives any FTP
response code in the 2xx range, or at the least should return TRUE when it
receives a standard FTP response code defined in RFC 959 in the 2xx range.

In particular it does not accept code 213 "File status" which is causing a
problem for me.

I checked the source for PHP v5.3.25 and 5.5.0RC1 and it is the same in
both, any response other than 226 or 250 or 200 is considered a failure.

Bug report 51190 indicates someone who had a similar problem with code
221.
In response to that ticket, ftp_put() was changed to accept code 200,
however this does not represent a general solution to the problem (and in
fact did not solve bug 51190 either according to its reporter.


Test script:
---------------
$ftp = ftp_connect('ftp.nowhere.com');
ftp_login($ftp, 'username', 'password');

$result = ftp_put($ftp, 'remote_file.bin', 'local_file.bin', FTP_BINARY);
/*
    STOR remote_file.bin
    150 File status okay; about to open data connection.
    216 closing data connection; File upload success; remote_file.bin
*/


Expected result:
----------------
1) $result is TRUE

2) No error is triggered

Actual result:
--------------
1) $result is FALSE

2) An error is triggered:
ftp_put(): File status okay; about to open data connection


-- 
Edit bug report at https://bugs.php.net/bug.php?id=64841&edit=1
-- 
Try a snapshot (PHP 5.4):   
https://bugs.php.net/fix.php?id=64841&r=trysnapshot54
Try a snapshot (PHP 5.3):   
https://bugs.php.net/fix.php?id=64841&r=trysnapshot53
Try a snapshot (trunk):     
https://bugs.php.net/fix.php?id=64841&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=64841&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=64841&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=64841&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=64841&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=64841&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=64841&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=64841&r=notwrong
Not enough info:            
https://bugs.php.net/fix.php?id=64841&r=notenoughinfo
Submitted twice:            
https://bugs.php.net/fix.php?id=64841&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=64841&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=64841&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=64841&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=64841&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=64841&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=64841&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=64841&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=64841&r=mysqlcfg

Reply via email to