From c73247fe2cf8c8695fe0c177474f9d4da1911c47 Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Tue, 8 Jan 2008 19:10:16 +0000 Subject: [PATCH] MFB: Fixed bug #43498 (file_exists() on a proftpd server got SIZE not allowed in ASCII mode). --- NEWS | 2 ++ ext/standard/ftp_fopen_wrapper.c | 1 + 2 files changed, 3 insertions(+) diff --git a/NEWS b/NEWS index 46fab777f1..952d319b66 100644 --- 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). diff --git a/ext/standard/ftp_fopen_wrapper.c b/ext/standard/ftp_fopen_wrapper.c index 58bc895c16..c8d4b7a481 100644 --- a/ext/standard/ftp_fopen_wrapper.c +++ b/ext/standard/ftp_fopen_wrapper.c @@ -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) { -- 2.50.1