Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2022-02-24 16:55:57 +0300
committerCôme Chilliet <come.chilliet@nextcloud.com>2022-02-24 16:55:57 +0300
commit0daec4b27ea34947691e6c27db8d84c821233a6f (patch)
tree376c2a654f3a37d4891a2a3c558c4f71d51c9222 /lib
parentd43dbfa0f2775dd5f9b2d24129e24d7cb67ad643 (diff)
Fix tmp file cleaning for bundled previews
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Preview/Bundled.php2
-rw-r--r--lib/private/Preview/ProviderV2.php4
2 files changed, 4 insertions, 2 deletions
diff --git a/lib/private/Preview/Bundled.php b/lib/private/Preview/Bundled.php
index 4da2486b76b..e0551bd392b 100644
--- a/lib/private/Preview/Bundled.php
+++ b/lib/private/Preview/Bundled.php
@@ -33,6 +33,8 @@ abstract class Bundled extends ProviderV2 {
protected function extractThumbnail(File $file, string $path): ?IImage {
$sourceTmp = \OC::$server->getTempManager()->getTemporaryFile();
$targetTmp = \OC::$server->getTempManager()->getTemporaryFile();
+ $this->tmpFiles[] = $sourceTmp;
+ $this->tmpFiles[] = $targetTmp;
try {
$content = $file->fopen('r');
diff --git a/lib/private/Preview/ProviderV2.php b/lib/private/Preview/ProviderV2.php
index 766e00f074a..0cb7eb59e21 100644
--- a/lib/private/Preview/ProviderV2.php
+++ b/lib/private/Preview/ProviderV2.php
@@ -35,7 +35,7 @@ abstract class ProviderV2 implements IProviderV2 {
protected $options;
/** @var array */
- private $tmpFiles = [];
+ protected $tmpFiles = [];
/**
* Constructor
@@ -109,7 +109,7 @@ abstract class ProviderV2 implements IProviderV2 {
/**
* Clean any generated temporary files
*/
- protected function cleanTmpFiles() {
+ protected function cleanTmpFiles(): void {
foreach ($this->tmpFiles as $tmpFile) {
unlink($tmpFile);
}