diff options
author | Felipe Pena <felipe@php.net> | 2008-07-11 18:33:35 +0000 |
---|---|---|
committer | Felipe Pena <felipe@php.net> | 2008-07-11 18:33:35 +0000 |
commit | 8cbd7cc7b9ad20ff839ede1634af0d1de53df0da (patch) | |
tree | 292c84ae4a849ea3ed360dc5a3d3bde16eb3f5bd | |
parent | 58c300ddf6b79bec2dda2a7f4fc8c85d96b186ec (diff) | |
download | php-git-8cbd7cc7b9ad20ff839ede1634af0d1de53df0da.tar.gz |
- MFB: Fixed bug #45449 (filesize() regression using ftp wrapper) (patch by crrodriguez at suse dot de)
-rw-r--r-- | ext/standard/ftp_fopen_wrapper.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/ext/standard/ftp_fopen_wrapper.c b/ext/standard/ftp_fopen_wrapper.c index a4924da2c7..e1339ccddc 100644 --- a/ext/standard/ftp_fopen_wrapper.c +++ b/ext/standard/ftp_fopen_wrapper.c @@ -775,6 +775,13 @@ static int php_stream_ftp_url_stat(php_stream_wrapper *wrapper, char *url, int f } php_stream_write_string(stream, "TYPE I\r\n"); /* we need this since some servers refuse to accept SIZE command in ASCII mode */ + + result = GET_FTP_RESULT(stream); + + if(result < 200 || result > 299) { + goto stat_errexit; + } + php_stream_printf(stream TSRMLS_CC, "SIZE %s\r\n", (resource->path != NULL ? resource->path : "/")); result = GET_FTP_RESULT(stream); if (result < 200 || result > 299) { |