From: Jan Gerber Date: Fri, 20 Jul 2012 01:18:31 +0000 (+0000) Subject: cleanup temp files left around by UploadStash X-Git-Tag: 1.31.0-rc.0~22998 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=c239df639bd61b9a6aff58092023d04361ae98d9;p=lhc%2Fweb%2Fwiklou.git cleanup temp files left around by UploadStash stashFile renames files to add an extension, this way it is no longer cleaned up by php. So we have to unlink it after storing it in the FileRepo. Change-Id: Iab697fc4535546dd25231dddf220e18f3b0b73be --- diff --git a/includes/upload/UploadStash.php b/includes/upload/UploadStash.php index 329ee22879..bbee0f5ba0 100644 --- a/includes/upload/UploadStash.php +++ b/includes/upload/UploadStash.php @@ -243,6 +243,9 @@ class UploadStash { } $stashPath = $storeStatus->value; + // we have renamed the file so we have to cleanup once done + unlink($path); + // fetch the current user ID if ( !$this->isLoggedIn ) { throw new UploadStashNotLoggedInException( __METHOD__ . ' No user is logged in, files must belong to users' );