Merge pull request #6586 from nextcloud/fix/app-install-extract-check

Check whether an app archive can be extracted
This commit is contained in:
Roeland Jago Douma 2017-09-27 10:41:21 +02:00 committed by GitHub
commit 90d7e8f6f4

View file

@ -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);