]> 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:34:43 +0000 (18:34 +0000)
committerFelipe Pena <felipe@php.net>
Fri, 11 Jul 2008 18:34:43 +0000 (18:34 +0000)
ext/standard/ftp_fopen_wrapper.c

index 47067db854c5d93bbb5c67aea45dd32c3492045b..c0569f9698c4c0a65a21597aa4d24b84777d6724 100644 (file)
@@ -776,6 +776,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) {