From: Felipe Pena Date: Fri, 11 Jul 2008 18:28:25 +0000 (+0000) Subject: - Fixed bug #45449 (filesize() regression using ftp wrapper) (patch by crrodriguez... X-Git-Tag: php-5.2.7RC1~216 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6074163f74eb8db06017bbbe8692b740e92e27f8;p=php - Fixed bug #45449 (filesize() regression using ftp wrapper) (patch by crrodriguez at suse dot de) --- diff --git a/ext/standard/ftp_fopen_wrapper.c b/ext/standard/ftp_fopen_wrapper.c index c8d4b7a481..3dde2f5fdb 100644 --- a/ext/standard/ftp_fopen_wrapper.c +++ b/ext/standard/ftp_fopen_wrapper.c @@ -777,6 +777,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) {