]> granicus.if.org Git - php/commitdiff
Fixed bug #43498 (file_exists() on a proftpd server got SIZE not
authorIlia Alshanetsky <iliaa@php.net>
Tue, 8 Jan 2008 19:08:50 +0000 (19:08 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Tue, 8 Jan 2008 19:08:50 +0000 (19:08 +0000)
allowed in ASCII mode).
# Original patch by crrodriguez at suse dot de

ext/standard/ftp_fopen_wrapper.c

index 8b8617f407afab10022709a8688e665ca99c9f1e..a4924da2c7590a787f36496cd00f0f37dbb5fdb9 100644 (file)
@@ -774,6 +774,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) {