summaryrefslogtreecommitdiffstats
path: root/lib/private/Installer.php
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2017-09-20 14:07:17 +0200
committerChristoph Wurst <christoph@winzerhof-wurst.at>2017-09-20 14:07:17 +0200
commit2e19c42bc55b4f8e9228ba740ba95933dbff18ee (patch)
tree779ed1fa9018830ffa5147059cbacbec0cd3cbbb /lib/private/Installer.php
parente43400eddbfdac765c8dcc5d90b4398e304dbaaf (diff)
downloadnextcloud-server-2e19c42bc55b4f8e9228ba740ba95933dbff18ee.tar.gz
nextcloud-server-2e19c42bc55b4f8e9228ba740ba95933dbff18ee.zip
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 <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib/private/Installer.php')
-rw-r--r--lib/private/Installer.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/private/Installer.php b/lib/private/Installer.php
index 4d7e5016653..d5082a7fad2 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);