From bee64c0d3ff99061c6ee1d3b6ceb7c4de588f86a Mon Sep 17 00:00:00 2001 From: emc3 Date: Wed, 8 Oct 2003 17:41:54 +0000 Subject: [PATCH] Added unlink() call to clean up any possible temporary files. git-svn-id: http://svn.automattic.com/wordpress/trunk@435 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/b2upload.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/wp-admin/b2upload.php b/wp-admin/b2upload.php index c68284eb8..09e70d1ef 100644 --- a/wp-admin/b2upload.php +++ b/wp-admin/b2upload.php @@ -171,8 +171,11 @@ if (!empty($HTTP_POST_VARS)) { //$img1_name != "") { if (!$moved) { $moved = copy($img1, $pathtofile2); } - if (!$moved) + if (!$moved) { die("Couldn't Upload Your File to $pathtofile2."); + } else { + @unlink($img1); + } // duplicate-renaming function contributed by Gary Lawrence Murphy ?> @@ -208,8 +211,11 @@ if (!empty($HTTP_POST_VARS)) { //$img1_name != "") { $moved = copy($img1, $pathtofile); } // Still couldn't get it. Give up. - if (!moved) + if (!moved) { die("Couldn't Upload Your File to $pathtofile."); + } else { + @unlink($img1); + } } else { rename($img1, $pathtofile) or die("Couldn't Upload Your File to $pathtofile.");