]> granicus.if.org Git - php/commitdiff
Fix ftp_size() returning bogus results.
authorVlad Krupin <vlad@php.net>
Mon, 18 Mar 2002 22:26:32 +0000 (22:26 +0000)
committerVlad Krupin <vlad@php.net>
Mon, 18 Mar 2002 22:26:32 +0000 (22:26 +0000)
# make sure the server is in BINARY mode before requesting file size.

ext/ftp/ftp.c

index b41367926ae5749ef19d493f72161224cc96c02f..d7d7d8a8f1f9e16a409dc9f62740caebf6be1562 100644 (file)
@@ -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)