]> granicus.if.org Git - php/commitdiff
- Fixed bug #45449 (filesize() regression using ftp wrapper) (patch by crrodriguez...
authorFelipe Pena <felipe@php.net>
Fri, 11 Jul 2008 18:28:25 +0000 (18:28 +0000)
committerFelipe Pena <felipe@php.net>
Fri, 11 Jul 2008 18:28:25 +0000 (18:28 +0000)
ext/standard/ftp_fopen_wrapper.c

index c8d4b7a481f7312870ae6c3be4c4ff2b4fbfd24a..3dde2f5fdb8347830bc947eff65dd9a76e282ca2 100644 (file)
@@ -777,6 +777,13 @@ static int php_stream_ftp_url_stat(php_stream_wrapper *wrapper, char *url, int f
        }
 
        php_stream_write_string(stream, "TYPE I\r\n"); /* we need this since some servers refuse to accept SIZE command in ASCII mode */
+
+       result = GET_FTP_RESULT(stream);
+
+       if(result < 200 || result > 299) {
+               goto stat_errexit;
+       }
+
        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) {