From 4c0c80be8f1aee7bc71b0fbf456215ee4aaa7733 Mon Sep 17 00:00:00 2001 From: Marco Dickert Date: Tue, 4 Aug 2020 11:58:11 +0200 Subject: [PATCH] Fix zipnload temporary file Signed-off-by: Marco Dickert --- src/main.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main.php b/src/main.php index 6971ef3..89e195b 100644 --- a/src/main.php +++ b/src/main.php @@ -812,7 +812,11 @@ IFM_ASSETS $this->jsonResponse( array( "status" => "ERROR", "message" => $this->l['invalid_filename'] ) ); else { unset( $zip ); - $dfile = $this->pathCombine( __DIR__, $this->config['tmp_dir'], uniqid( "ifm-tmp-" ) . ".zip" ); // temporary filename + if ($this->isAbsolutePath($this->config['tmp_dir'])) + $dfile = $this->pathCombine( $this->config['tmp_dir'], uniqid( "ifm-tmp-" ) . ".zip" ); // temporary filename + else + $dfile = $this->pathCombine( __DIR__, $this->config['tmp_dir'], uniqid( "ifm-tmp-" ) . ".zip" ); // temporary filename + try { IFMArchive::createZip(realpath($d['filename']), $dfile, array($this, 'isFilenameValid')); if( $d['filename'] == "." ) {