cleanup temp files left around by UploadStash
authorJan Gerber <j@thing.net>
Fri, 20 Jul 2012 01:18:31 +0000 (01:18 +0000)
committerJan Gerber <j@thing.net>
Fri, 20 Jul 2012 01:18:31 +0000 (01:18 +0000)
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

includes/upload/UploadStash.php

index 329ee22..bbee0f5 100644 (file)
@@ -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' );