From: Vlad Krupin Date: Mon, 18 Mar 2002 22:26:32 +0000 (+0000) Subject: Fix ftp_size() returning bogus results. X-Git-Tag: php-4.3.0dev-ZendEngine2-Preview1~1250 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7139845af98013fc589b49887211a8c0a8ec88b7;p=php Fix ftp_size() returning bogus results. # make sure the server is in BINARY mode before requesting file size. --- diff --git a/ext/ftp/ftp.c b/ext/ftp/ftp.c index b41367926a..d7d7d8a8f1 100644 --- a/ext/ftp/ftp.c +++ b/ext/ftp/ftp.c @@ -685,6 +685,8 @@ ftp_size(ftpbuf_t *ftp, const char *path) if (ftp == NULL) return -1; + if (!ftp_type(ftp, FTPTYPE_IMAGE)) + return -1; if (!ftp_putcmd(ftp, "SIZE", path)) return -1; if (!ftp_getresp(ftp) || ftp->resp != 213)