From: Felipe Pena Date: Fri, 11 Jul 2008 18:34:43 +0000 (+0000) Subject: - MFB: Fixed bug #45449 (filesize() regression using ftp wrapper) (patch by crrodrigu... X-Git-Tag: BEFORE_HEAD_NS_CHANGE~1300 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2a55e75300f803a15cf68ab1b1bbdadfec1c3a7f;p=php - MFB: 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 47067db854..c0569f9698 100644 --- a/ext/standard/ftp_fopen_wrapper.c +++ b/ext/standard/ftp_fopen_wrapper.c @@ -776,6 +776,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) {