summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelipe Pena <felipe@php.net>2008-07-11 18:33:35 +0000
committerFelipe Pena <felipe@php.net>2008-07-11 18:33:35 +0000
commit8cbd7cc7b9ad20ff839ede1634af0d1de53df0da (patch)
tree292c84ae4a849ea3ed360dc5a3d3bde16eb3f5bd
parent58c300ddf6b79bec2dda2a7f4fc8c85d96b186ec (diff)
downloadphp-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.c7
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) {