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

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