From 2e19c42bc55b4f8e9228ba740ba95933dbff18ee Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Wed, 20 Sep 2017 14:07:17 +0200 Subject: [PATCH] Check whether an app archive can be extracted If extraction fails we should not continue the installation/update process as the info.xml cannot be loaded and an unrelated error occurs. Signed-off-by: Christoph Wurst --- lib/private/Installer.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/private/Installer.php b/lib/private/Installer.php index 4d7e501665..d5082a7fad 100644 --- a/lib/private/Installer.php +++ b/lib/private/Installer.php @@ -288,7 +288,14 @@ class Installer { $archive = new TAR($tempFile); if($archive) { - $archive->extract($extractDir); + if (!$archive->extract($extractDir)) { + throw new \Exception( + sprintf( + 'Could not extract app %s', + $appId + ) + ); + } $allFiles = scandir($extractDir); $folders = array_diff($allFiles, ['.', '..']); $folders = array_values($folders);