Use TempFSFile in UploadFromUrl
Make it a little harder for the developer to leak files in the temp directory by managing the temporary file with a TempFSFile instance. Change-Id: I8bafc3a6e6212781d9e2e4f8f370ce7c446f1fd5
This commit is contained in:
parent
8d485c8309
commit
e4009c7367
1 changed files with 4 additions and 1 deletions
|
|
@ -204,13 +204,16 @@ class UploadFromUrl extends UploadBase {
|
|||
}
|
||||
return Status::newGood();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new temporary file in the URL subdirectory of wfTempDir().
|
||||
*
|
||||
* @return string Path to the file
|
||||
*/
|
||||
protected function makeTemporaryFile() {
|
||||
return tempnam( wfTempDir(), 'URL' );
|
||||
$tmpFile = new TempFSFile( 'URL' );
|
||||
$tmpFile->bind( $this );
|
||||
return $tmpFile->getPath();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue