]> granicus.if.org Git - php/commitdiff
MFH: Fixed bug #26113 (remove leftover local file when ftp_get/ftp_nb_get
authorIlia Alshanetsky <iliaa@php.net>
Tue, 4 Nov 2003 20:56:56 +0000 (20:56 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Tue, 4 Nov 2003 20:56:56 +0000 (20:56 +0000)
fails).

NEWS
ext/ftp/php_ftp.c

diff --git a/NEWS b/NEWS
index 7e4748348c4bb5f0ab118766fb08205659d3122c..8e1b5a71d0b0fe60f40cbe983f95d0c224c04215 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,8 @@ PHP 4                                                                      NEWS
 ?? ??? 2003, Version 4.3.5
 - Fixed header handler in NSAPI SAPI module (header->replace was ignored,
   send_default_content_type now sends value from php.ini). (Uwe Schindler)
+- Fixed bug #26113 (remove leftover local file when ftp_get/ftp_nb_get fails).
+  (Ilia)
 - Fixed bug #26105 (Compile failure on gcc version 3.0.X). (Ilia)
 - Fixed bug #26103 (ext/mime_magic causes compile failure in ext/mssql). (Jani)
 - Fixed bug #26097 (gdImageColorClosestAlpha() returns incorrect results).
index c286e6ed6550d5e115c83853e2fcabb4f79ac5aa..6474115cb898a19b80abeaf3c84b9d6acc861a1d 100644 (file)
@@ -636,6 +636,7 @@ PHP_FUNCTION(ftp_get)
 
        if (!ftp_get(ftp, outstream, remote, xtype, resumepos)) {
                php_stream_close(outstream);
+               VCWD_UNLINK(local);
                php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf);
                RETURN_FALSE;
        }
@@ -711,6 +712,7 @@ PHP_FUNCTION(ftp_nb_get)
 
        if ((ret = ftp_nb_get(ftp, outstream, remote, xtype, resumepos TSRMLS_CC)) == PHP_FTP_FAILED) {
                php_stream_close(outstream);
+               VCWD_UNLINK(local);
                php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf);
                RETURN_LONG(PHP_FTP_FAILED);
        }