From cdd97b142f25262de6ffcfa7f76e6b8f83102117 Mon Sep 17 00:00:00 2001 From: "Michael Kaufmann (d00p)" Date: Thu, 4 Aug 2016 21:49:33 +0200 Subject: [PATCH] extract auto-update archive to correct folder regardless of the folder being named 'froxlor' or not, future auto-update archives will not have the froxlor-folder prefixed, fixes #1645 Signed-off-by: Michael Kaufmann (d00p) --- admin_autoupdate.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/admin_autoupdate.php b/admin_autoupdate.php index a6d47dc2..f1a7672e 100644 --- a/admin_autoupdate.php +++ b/admin_autoupdate.php @@ -85,7 +85,7 @@ if ($page == 'overview') { } elseif ($isnewerversion == 0) { // all good - standard_success ('noupdatesavail'); + standard_success ('noupdatesavail'); } else { standard_error ('customized_version'); } @@ -122,7 +122,7 @@ elseif ($page == 'getdownload') { // remove old archive if (file_exists($localArchive)) { - @unlink($localArchive); + @unlink($localArchive); } // store archive @@ -137,15 +137,15 @@ elseif ($page == 'getdownload') { // validate the integrity of the downloaded file $_shouldsum = @file_get_contents($toCheck); if (!empty($_shouldsum)) { - $_t = explode(" ", $_shouldsum); - $shouldsum = $_t[0]; + $_t = explode(" ", $_shouldsum); + $shouldsum = $_t[0]; } else { - $shouldsum = null; + $shouldsum = null; } $filesum = hash_file('sha256', $localArchive); if ($filesum != $shouldsum) { - redirectTo($filename, array('s' => $s, 'page' => 'error', 'errno' => 9)); + redirectTo($filename, array('s' => $s, 'page' => 'error', 'errno' => 9)); } // to the next step @@ -166,8 +166,8 @@ elseif ($page == 'extract') { $zip = new ZipArchive; $res = $zip->open($localArchive); if ($res === true) { - $log->logAction(ADM_ACTION, LOG_NOTICE, "Extracting ".$localArchive." to ".dirname(FROXLOR_INSTALL_DIR)); - $zip->extractTo(dirname(FROXLOR_INSTALL_DIR)); + $log->logAction(ADM_ACTION, LOG_NOTICE, "Extracting ".$localArchive." to ".FROXLOR_INSTALL_DIR); + $zip->extractTo(FROXLOR_INSTALL_DIR); $zip->close(); // success - remove unused archive @unlink($localArchive);