]> 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:10:16 +0000 (19:10 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Tue, 8 Jan 2008 19:10:16 +0000 (19:10 +0000)
allowed in ASCII mode).

NEWS
ext/standard/ftp_fopen_wrapper.c

diff --git a/NEWS b/NEWS
index 46fab777f158217d953cb3d103ba84d8f65e32e3..952d319b66deae979226aeaef907d6997b9e0af3 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -22,6 +22,8 @@ PHP                                                                        NEWS
   Ilia, Tony)
 - Fixed bug #43495 (array_merge_recursive() crashes with recursive arrays).
   (Ilia)
+- Fixed bug #43498 (file_exists() on a proftpd server got SIZE not
+  allowed in ASCII mode). (Ilia, crrodriguez at suse dot de)
 - Fixed bug #43493 (pdo_pgsql does not send username on connect when password
   is not available). (Ilia)
 - Fixed bug #43482 (array_pad() does not warn on very small pad numbers).
index 58bc895c16b7363078d21dcd4fe23b20b3ec8fab..c8d4b7a481f7312870ae6c3be4c4ff2b4fbfd24a 100644 (file)
@@ -776,6 +776,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) {