]> granicus.if.org Git - php/commitdiff
MFB: Fixed bug #43498 (file_exists() on a proftpd server got SIZE not
authorIlia Alshanetsky <iliaa@php.net>
Tue, 8 Jan 2008 19:09:12 +0000 (19:09 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Tue, 8 Jan 2008 19:09:12 +0000 (19:09 +0000)
allowed in ASCII mode).

ext/standard/ftp_fopen_wrapper.c

index 0d9c12cb277143e02c7c71c1d69f6ed17c3cbf4e..47067db854c5d93bbb5c67aea45dd32c3492045b 100644 (file)
@@ -775,6 +775,7 @@ static int php_stream_ftp_url_stat(php_stream_wrapper *wrapper, char *url, int f
                ssb->sb.st_mode |= S_IFDIR;
        }
 
+       php_stream_write_string(stream, "TYPE I\r\n"); /* we need this since some servers refuse to accept SIZE command in ASCII mode */
        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) {