[handle_archive] standard tmpdir
This commit is contained in:
parent
cff1bbad7d
commit
8100ab31a9
1 changed files with 3 additions and 2 deletions
|
@ -26,8 +26,9 @@ class ArchiveFileHandler extends DataHandlerExtension
|
||||||
{
|
{
|
||||||
if ($this->supported_mime($event->mime)) {
|
if ($this->supported_mime($event->mime)) {
|
||||||
global $config, $page;
|
global $config, $page;
|
||||||
$tmp = sys_get_temp_dir();
|
$tmpdir = shm_tempnam("archive");
|
||||||
$tmpdir = "$tmp/shimmie-archive-{$event->hash}";
|
unlink($tmpdir);
|
||||||
|
mkdir($tmpdir, 0755, true);
|
||||||
$cmd = $config->get_string('archive_extract_command');
|
$cmd = $config->get_string('archive_extract_command');
|
||||||
$cmd = str_replace('%f', $event->tmpname, $cmd);
|
$cmd = str_replace('%f', $event->tmpname, $cmd);
|
||||||
$cmd = str_replace('%d', $tmpdir, $cmd);
|
$cmd = str_replace('%d', $tmpdir, $cmd);
|
||||||
|
|
Reference in a new issue