From 8cbd7cc7b9ad20ff839ede1634af0d1de53df0da Mon Sep 17 00:00:00 2001 From: Felipe Pena Date: Fri, 11 Jul 2008 18:33:35 +0000 Subject: [PATCH] - MFB: Fixed bug #45449 (filesize() regression using ftp wrapper) (patch by crrodriguez at suse dot de) --- ext/standard/ftp_fopen_wrapper.c | 7 +++++++ 1 file changed, 7 insertions(+) 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) { -- 2.40.0