From 8100ab31a94299dd97542e69c535f6b0c38be2e9 Mon Sep 17 00:00:00 2001 From: Shish Date: Wed, 21 Feb 2024 21:31:20 +0000 Subject: [PATCH] [handle_archive] standard tmpdir --- ext/handle_archive/main.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ext/handle_archive/main.php b/ext/handle_archive/main.php index 061705ff..85bd910e 100644 --- a/ext/handle_archive/main.php +++ b/ext/handle_archive/main.php @@ -26,8 +26,9 @@ class ArchiveFileHandler extends DataHandlerExtension { if ($this->supported_mime($event->mime)) { global $config, $page; - $tmp = sys_get_temp_dir(); - $tmpdir = "$tmp/shimmie-archive-{$event->hash}"; + $tmpdir = shm_tempnam("archive"); + unlink($tmpdir); + mkdir($tmpdir, 0755, true); $cmd = $config->get_string('archive_extract_command'); $cmd = str_replace('%f', $event->tmpname, $cmd); $cmd = str_replace('%d', $tmpdir, $cmd);